Internationalization of Opinio

Opinio can be configured to support any language. There are two parts in Opinio localization:

  1. Language (texts in the administration module)
  2. System character encoding

Texts in the administration module

All the screen texts/labels in the system can be displayed in a language selected by the user. Users can set the language from the user profile screen. Only supported languages will be shown in the list. To add a new language you will need to create a resource file to hold your localized texts.

The resource files are located in the OPINIO_HOME/WEB-INF/classes/i18n folder.

  1. Copy ApplicationResources.properties into a new resource file. Add your language code to the file name:

    • ApplicationResources_ru.properties - for russian resource file
    • ApplicationResources_it.properties - for italian resource file

    If your language uses other than latin characters, add '_native' to the end of the file name. Example: ApplicationResources_ru.properties_native

  2. Translate all messages in the file to your language. The resource file is a text file and can be edited in any text editor. For non-latin characters the editor must support UTF-8 and the file must be saved with UTF-8 encoding.

    The file contains key-value pairs. Only values must be translated.

    English version:

    	menu.surveys=Surveys
    	menu.userAdmin=Users
    	menu.systemInfo=Setup
    						

    Norwegian version:

    	menu.surveys=Spørrenundersøkelser
    	menu.userAdmin=Brukere
    	menu.systemInfo=Konfigurasjon
    						
  3. Resource files must be saved in ASCII. For non-latin characters you will need to convert the file from native encoding to ASCII. Use built-in native2ascii Java tool to do this (it must be in one line only, but due to space limitations, it was broken up in two lines here):

    	native2ascii -encoding UTF-8 ApplicationResources_ru.properties_native ...
    				ApplicationResources_ru.properties
    						
  4. Update file OPINIO_HOME/admin/include/supportedLanguages.jsp. Add a new line for your language:

    	languages.add(new OptionBean("Russian", "ru"));
    						

System character encoding

System character encoding is the encoding for texts entered in all input fields. It can be set from the setup screen. Latin-1 (ISO-8859-1) is default. Select UTF-8 (Unicode) for non-latin characters.

If using UTF-8 encoding, check that the database supports Unicode. You might need to configure it to make it work.