Page tree
Skip to end of metadata
Go to start of metadata

Info

Starting with SWAT 20.06 release

The translation functionality offers the possibility to translate the application in different languages. The main idea is based on namespaces, which offers the possibility of having different translations for multiple customers.

The namespace(s) are JSON files which store the translations for different parts of the application (Form fields, Grid column labels, Ribbons, Toolbars etc). For a particular namespace, there can be multiple languages defined (en, de, fr etc). All translations are identified by keys which are actually object properties in the JSON files.

The language can be set by adding ?setLng= in the URL. For example, one can add ?setLng=de which will load the German translations, or ?setLng=en for English translations.

The namespace(s) can be set through a PASOE setting: 

<TranslationNamespaces>akioma.common</TranslationNamespaces>

 

We also provide support for fallback language and fallback namespaces.

  • fallbackLng – is set internally to German (de)
  • fallbackNS – is set only if the <TranslationNamespaces> attribute in the PASOE config contains multiple namespaces (for example, for ‘akioma.customer,akioma.common’, fallbackNS will be ‘akioma.common

The fallback namespaces (fallbackNS) allows specifying multiple namespaces, that build upon each other. This is useful for customer specific namespaces, which will only contain translations different than the standard. Furthermore, if a key is not found in the first namespace then it will be checked in the next namespace defined. The setting is done in the PASOE config, like this:

<TranslationNamespaces>akioma.customer,akioma.common</TranslationNamespaces>

 

Example:

If the PASOE setting would be ‘akioma.customer,akioma.common’ and the language is set to ?setLng=en, the order is the following:

  1. If the key is not found in en/akioma.customer.json then it will use the fallbackLng (de), and it will search the key in de/akioma.customer.json
  1. If the key is not found in the fallbackLng (de/akioma.customer.json), then it will use the fallbackNS (in this case akioma.common). So, will search in en/akioma.common.json
  2. If the key is not found in en/akioma.common.json, it will use again the fallbackLng (de), so it will search in de/akioma.common.json
  3. If still not found, it will return the default value (untranslated)
  • No labels