2.7.5. Translating the language selection form

When choosing a language as on the screenshot above, the user is presented with a list of languages on the left side in the current chosen language and on the right side, the same language translated into its own language. Those texts are obtained from the JDK API java.util.Locale.getDisplayedLanguage() and java.util.Locale.getDisplayedCountry() (if needed) and all languages may not be translated and can also depend on the JVM currently used. It is still possible to override those values by editing the locale.portal.webui resource bundle. To do this, edit the gatein.ear/portal.war/WEB-INF/classes/locale/portal/webui_xx_yy.properties where xx_yy represents the country code of the language in which you want to translate a particular language. In that file, add or modify a key, such as Locale.xx_yy with the value being the translated string.

Example: Changing the displayed text for Traditional Chinese in French

First edit gatein.ear/portal.war/WEB-INF/classes/locale/portal/webui_fr.properties where ne is the country code for French, and add the following key into it:

Locale.zh_TW=Chinois traditionnel

After a restart, the language will be updated in the user interface when a user is trying to change the current language.


Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus