There is no need to rebuild the application for a particular language. When the application is built, all the messages files in all the available languages are included. The default locale can be changed by setting the application property unitime.locale through the Administration > Defaults > Configuration page.
For a particular HTTP session, the locale can be also changed using the locale parameter, e.g., see our online demo in Czech: https://demo.unitime.org/UniTime?locale=cs.
At the moment, the following localizations are available in the official UniTime build:
en ... English (default)
en_UK ... English, but using 24-hour time format and MM.DD.YYYY dates
cs ... Czech
pl ... Polish
Translating UniTime using POEditor
Starting with UniTime 4.7, we use POEditor.com to support the cooperation of users on the translation of UniTime to other languages. Please note that if you want your translation to be a part of the standard distribution of UniTime, you need to sign a contributor license agreement for Apereo.
If you are interested in translating UniTime into a particular language, please send us your email at firstname.lastname@example.org, and we will give you permission in POEditor. Alternatively, you can request to join the translation of UniTime at poeditor.com/join/project/Aa5qIUPsnp .
With POEditor.com, messages are translated at poeditor.com/projects/view?id=568029 . To test the translation in your version of UniTime, you will need to make a custom build using the following procedure:
Have a local clone of the UniTime repository
Download the translation for your localization using the 2-letter language code (e.g., pl for Polish) in the UniTime project
This will use Apache Ant to download the latest transactions from poeditor.com and create the appropriate .properties files. It will also make sure that the given language is registered in UniTime.gwt.xml.
Make a custom UniTime build
Once done, the new build is available in the Distributions folder (e.g., Distributions/UniTime.war), which can be deployed in the same way as the official build.
If you want to help with translation to another language, please consider looking at the English dictionary, which contains terminology used in UniTime in the original English version. It is advisable to start by translating these terms first, then fill in the translation of particular messages.
If you wish to use a different tool to provide translations (such as POEdit), the following command
can be used to export the existing translations of the given XX language into a PO format. The generated PO file is available under Documentation/Translations (e.g., Documentation/Translations/UniTime4.7_XX.po).
A modified PO file can be imported back by using
where XX is the 2-letter language code, and the translations are imported from the Documentation/Translations/UniTime4.7_XX.po file.
Most of the UniTime application was written using Apache Struts, however, new pages and components are written using Google Web Toolkit (GWT). For localization of GWT parts, we use its i18n capabilities.
An example of using localization tags in a JSP file:
An example of using localization in a Java file:
An example of using localization in a GWT client code:
Here is an example of a change localizing a particular page. The default messages are in English, the language-dependent messages are in a property file with the same name (plus identification of the language using two character iso language code), e.g., see Czech translation of CourseMessages.
Note that the language has to be added in the UniTime.gwt.xml (as a supported language, extending locale property) for the GWT compiler to create the appropriate language mutation.