Supporting Multiple Languages

The static texts displayed by the Widget Framework are stored in an application resource file called ApplicationResources.properties. Each publication has its own copy of ApplicationResources.properties, located in the following folder:

publication-path/WEB-INF/classes/com/escenic/framework/

The contents of ApplicationResources.properties are the same in all publications.

You can add support for a languages other than US English as follows:

  1. Make a copy of ApplicationResources.properties (download it from one of your publications on the server).

  2. Translate the contents to the required language.

  3. Rename the translated file to ApplicationResources_locale.properties, where locale is a locale code supported by Java (see http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html). A German application resource file, for example, could be called ApplicationResources_de_DE.properties or ApplicationResources_de_AT.properties (for Austrian German).

  4. Upload the translated file back to publication-path/WEB-INF/classes/com/escenic/framework/. If you have several publications, then upload it to all of them.

Now all you need to do to switch a publication to the new language is to set the locale section parameter in your publication's home section to the correct locale code (de_DE, for example). If there is no locale section parameter in the publication home section, then add it. To switch the publication back to US English, set locale to en_US.

It is not necessary to restart the Content Engine when you add a new application resource file. However, you do need to restart the Content Engine if you change the contents of an existing application resource file. You can avoid having to restart the Content Engine in this case by:

  1. Renaming the modified application resource file (from ApplicationResources_de_DE.properties to ApplicationStrings_de_DE.properties, for example)

  2. Modifying the javax.servlet.jsp.jstl.fmt.localizationContext property in your web.xml accordingly. By default it is set to com.escenic.framework.ApplicationResources, so in this case you would want to change it to com.escenic.framework.ApplicationStrings.