Skip to content

Internationalization

Christian Gendreau edited this page Jul 15, 2014 · 9 revisions

Adding new language

The Explorer can be translated into different languages. To achieved that, 2 new files are required to be translated.

  • ApplicationResources_LANG.properties
  • urlResource_LANG.properties *

LANG represents the ISO 639-1 code for the new language.

* : inverted properties file. e.g. value_in_another_language=english_key. For full example take a look at the French URL resource.

web-theme

If you are using your own web-theme, you also need to provide the resources for your theme.

Internationalized URLs

The Explorer is using full i18n URLs meaning that, for example, the search page URL is /en/search for English and /fr/rechercher for French.

Details

Internally, all requests are converted to /search?lang=fr or /search?lang=en. e.g. “/fr/rechercher” -> “/search?lang=fr”

This technique deals with the part of the URL path that contains the language and i18n resource name. The application URL mapping can then ignore the language and translation.

Exclusions

  • Query parameters
  • Paths that start with /assets/ (static resources likes JavaScript, CSS and image files)
  • Paths that start with /ws/ (web service end-point)

Library

The library used to map the received path to a resource path is OCPSoft Rewrite.