The Project: Lost in Translation
Many websites need to be displayed in multiple languages. To handle this, all the language- specific labels on the website are assigned a unique key and stored in a translation file. A website can have multiple translations files—one for each language. Translation files are stored in JSON, which allows labels to be stored hierarchically. For example, we could group the labels together by each section of a webpage:
The website can reference each label in the HTML by its key in dot-notation ([url removed, login to view]
= “Welcome to my Webpage!”). The key is dynamically replaced by the label when the page is rendered. This means that your raw HTML pages will contain no actual text, just keys.
The downside of this technique is that is becomes difficult to see what label a key corresponds to without looking through a long JSON document. There’s got to be something we can do about that, right?
Your job is to create a web application that allows a user to search a provided translation file for a specific label. The search query will be the key of the label, in dot-notation. The requirements are as follows:
• When your application initializes, it must load and process a single JSON translation file named [url removed, login to view] (an example has been provided) and store the data in memory.
We will run your application using a different JSON file, but you can assume the JSON file will be valid. The value of a JSON object can only be a string (the label), or another JSON object (a nested JSON object). There will be no arrays in the JSON object.
• The front-end of the application will be a single web page with a search interface of your choosing. The search interface will contain a search box, for entering the key, and a search results area to display the matching label. For example, if someone searched for “[url removed, login to view]”, the search page should display: “User Name”. One only search result is possible since each key is unique. If the user enters an invalid key, or a key that could not be exactly matched from the JSON file, no search results should be returned.
• The application must be written using Java and Spring Boot ([url removed, login to view]). You may use whatever libraries or front-end frameworks you wish in order to achieve your goal.
• Do not collaborate with other people on this project. It should represent only your own work.
implement these extrafeatures:
• Make the search request using AJAX. Dynamically display the search results on the screen when the response is returned.
• A “reverse” search option: Allow the user to search by the label, and return all of the keys to which the label belongs. This search result can return multiple keys. Once again, only exact matches need to be considered. How the UI switches between the regular search and the reverse search is up to you.
• Some cool feature you think would bring value to the application.
Loading the JSON file in a usable format can be made easy by using the ObjectMapper class.
This class is an included dependency with any Spring Boot web application and can convert the raw JSON file into a Map which can be further processed to generate a set of keys and values.
In the map above, the value can be a String or another Map (in the case of a nested JSON object).
The End Product
include a small summary (no more than 1 page) of your thoughts on the project. Did you learn anything interesting? Did the end result turn out like you thought it would? Really anything that might be of interest to us! Ideally, we would like you to submit your work within 5 days of receiving this document. If your schedule won’t cooperate, please let us know.
3 威客就此工作平均出价 $52
Hi i am experienced C++ programmer and web designer. We can further discuss about your project in chat Relevant Skills and Experience C++ Programmer + Web Designer Proposed Milestones $30 USD - Milestone