Translate Opinio

Opinio support several languages for the administration screens. Users can select the preferred language on the My Profile screen. Only supported languages will be shown in the list.

New languages can be easily added to the system. 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 to a new resource file. Add your language code to a new file, for example:

    • 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 plain-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. Resulting 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. Restart the application server. All language files in folder OPINIO_HOME/WEB-INF/classes/i18n will be automatically loaded after server restart.