## 4.2. Internationalization and translations

### 4.2.1. Concept

OLAT uses Java properties files for all internationalization strings. There are some exceptions that will be discussed later in this paper.

The properties files are located in olat3/webapp/i18n/default/language_code. language_code stands for the locale. Examples: en, de, fr, en_US, de_CH...

Beginning from Release 5.0, the properties files are located in the subfolder _i18n of a respective java-package, postfixed with the language. E.g. org/olat/modules/fo/_i18n/LocalStrings_de.properties

If you wish to translate OLAT to a new language and you want to contribute this translation to the OLAT community, please contact us first. We have a dedicated translation server where your translations will automatically be checked into our CVS and we can communicate you the changes that happend in the code due to code refactoring and development. We would love to have your favorite language as an official OLAT language!

### 4.2.2. Configuration

Languages are configured in olat3/webapp/WEB-INF/olat_config.xml. Add new languages in the Localization module and set the default locale. You sould make your changes in the olat_config.xml.in rather than in the olat_config.xml file. You can then run ant config-all to generate your olat_config.xml file.

### 4.2.3. The online translation tool

OLAT has a handy translation tool built into the system so that you do not have to understand an IDE like eclipse. The main translation files can be edited via webbrowser.

During a translation phase it makes sense to set the flag localization.cache=false in the olat3/build.properties file. Set this property to true in a production environment since this reloads the file from disk for every request.

1. Log in as administrator

2. Use top navigation tab 'Administration'

3. Choose 'Online Translation Tool' from the menu

4. Select your new language or a language that you want to edit

5. Hit 'Create all ToDos' to create all properties for the new language as a copy from the systems default language

6. Choose a package and start translating. ToDo's have an X before the = sign. E.g. command.closeprintingX= is not translated und should be set to command.closeprinting=Close printview

7. Save your changes

8. When debug=true is configured in the build.properties file you can use the GUI debug mode (bottom left side of screen) to directly translate any string in the GUI or even modify the HTML fragments.

### 4.2.4. Files not covered by the Online Translation Tool

In addition to the files located in the i18n directory some localized strings are located at some other places. These exceptions are described below:

- olat3/webapp/WEB-INF/src/org/olat/ims/resources/xsl/results2html_*.xsl

  Files used for the QTI results screen. Copy and paste from a language that you understand and create a new file.

- olat3/webapp/static/disclaimer/disclaimer_*.html

  File used in registration procedure. Copy and paste from a language that you understand and create a new file.

- olat3/webapp/static/flash/localStrings_*.properties

  Files used by the Instant Messaging Flash client. Copy and paste from a language that you understand and create a new file. After the translation process copie the files to webapp/static/flash and add a "&" at the beginning and end of each file. The files have to reside in the static folder as the flash IM client loads them dynamically at startup.

- olat3/webapp/WEB-INF/src/org/olat/core/gui/components/form/_static/js/jscalendar/lang/calendar-*.js

  The popup calendar files. They are already available in several languages. However, some languages seem to be broken. If the calendar popup does not work in your language then the best approach is to compare your language file with the "de" or "en" version and add the missing elements.

- olat3/webapp/help/help-course_*.zip

  This is the help course that launches when you click on help in the top navigation. Unzip an available course and modify it so that it fits your needs. Be careful when modifying the course structure by hand!

  Do not forget to configure the new help course for your language in the olat_config.xml file (see below).

- olat3/webapp/WEB-INF/olat_config.xml

  You should modify the olat_config.xml.in file and then run ant config-all to generate the olat_config.xml file!

  Add your language in the I18nManager module and in the AuthProvider section.

A good link about servlets / i18n can be found at http://tagunov.tripod.com/i18n/i18n.html