Spring MVC affords internationalization support (see documentation here)
How textual content is separated from jsp pages
We try to keep all textual content separate from jsp pages by putting them into properties files as key=value pairs.
... title.separator=- application.title=PAS Portal sail.logo.alttext=SAIL logo containing two stylized sails and the word SAIL. banner.heading=PAS Portal welcome=Welcome: index.title=Home ...
In the jsp files, the content is retrieved using Spring's message tag:
<spring:message code="KEY" />
... <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <link href="<spring:theme code="stylesheet"/>" media="screen" rel="stylesheet" type="text/css" /> <title><spring:message code="application.title" /> <spring:message code="title.separator" /> <spring:message code="index.title" /></title> </head> ...
How to add new languages
Adding a new language is straightforward:
1) Create a new file resources/messages/pas/ui-html_XX.properties, where XX is one of the following:
Danish (da) - Dutch (nl) - English (en) - Estonian (et)
French (fr) - German (de) - Greek-Modern (el)
Italian (it) - Norwegian (no) - Norwegian Nynorsk (nn) - Korean (ko)
Portugese (pt) - Luxembourgeois* (ltz)
Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
Russian (ru) - Croatian (hr)
Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
English (en) - Estonian (et) - French (fr) - German (de)
Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
Norwegian (no) - Polish (pl) - Portugese (pt)
Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
2) Copy everything from resources/messages/pas/ui-html.properties file into the new file.
3) Replace the values in the new files with the translated text
- (Description from website) This application's intend is to help in the localization (l10n) of those programs that have been internationalized following the Java's standard internationalization (i18n) mechanism. In short, it allows the edition of resource bundle files. In contrast to other similar tools, it shows the keys and values of several languages at the same time, in a spreadsheet, giving a global vision of the resources files. This way it is easier to determine the level of completeness of each translation.
- Google's Translation tool. Translate at your own risk!
How to use prbeditor to translate
1. startup prbeditor: https://prbeditor.dev.java.net/ When prompted, allow access to your computer.
2. open ui-html.properties (file->open). If people already started translating WISE to your language, you will see your language in "Select Locales to Open" window. If you see it, choose it and hit OK. If you don't, just hit OK. You will be able to add your language in the next step.
3. go to Locale->New Locale. Select your language and hit OK.
4. A new column for your language should now be visible next to the default english column.
5. type translations in your language column.
6. when you want to save your work, hit the save icon (floppy disk icon) or File->save. you should now see a new file, ui-html_XX.properties, where XX is your locale.
Currently supported languages
In the TELS Portal, we currently support:
- en (resources/messages/tels/ui-html.properties)
- de (resources/messages/tels/ui-html_de.properties)