Extend Languages¶
Insight-Clients (Mobile & Explorer) come with three languages configured: English, German and French.
English is the default or fallback language. On start up the client tries to determine the language of the environment (e.g. browser) and uses its configured language. So if a German browser is used the language automatically is set to German. The user can manually switch the language in the settings of the client.
Extend the existing translation keys¶
It is possible to extend the existing translation with customer specific keys/strings which then can be used in configuration files.
The language files reside in the application server configuration folder: ".../inside/wildfly/standalone/configuration/insight/i18n"
For every language a translation file exists, for example "locale.en.json" and "locale.de.json". Customers are not supposed to make changes in those files as those changes will be overwritten with the next update/patch. To overwrite or add keys to the translations customers must create a file "locale.en.customer.json" or "locale.de.customer.json" and overwrite/add keys in those files. The files will remain untouched during an update or patch.
To overwrite an existing key simply copy and paste the entries from the default file ("locale.en.json") to the customer file ("locale.en.customer.json") and change the text after the key. Don't copy all translations to the customer file! Make sure the newly created file is a valid .json-file with opening and closing curly braces.
Example:
{ // locale.en.json
[...],
"EXPERT_SEARCH_DELETE_SUCCESSFUL": "Expertsearch successfully deleted",
"EXPERT_SEARCH_SAVE_SUCCESSFUL": "Expertsearch successfully saved",
[...]
}
{ // locale.en.customer.json
"EXPERT_SEARCH_DELETE_SUCCESSFUL": "Remove Expertsearch: OK",
"EXPERT_SEARCH_SAVE_SUCCESSFUL": "Save Expertsearch: OK"
}
To add own translations add your own keys, maybe prefixed with your company name, to the customer.json-file. You can then use the defined key in your tree configurations.
Example:
{ // locale.en.customer.json
"GIS_MENU_OPEN_WORKORDER_DASHBOARD": "Open Dashboard: Workorders"
}
{ // workorder.json
[...]
"menus": [{
"label": "GIS_MENU_OPEN_WORKORDER_DASHBOARD",
"icon": "icon-open",
"action": "kibanaOpen",
"actionValues": [{
...
}]
},
[...]
}
Add a new language¶
To add a new language copy an existing language file, for example "locale.en.json", and name the new file with the locale shortcut for the new language, for example "locale.nl.customer.json". Translate all keys to the new language in the newly created file.
The clients read the existing languages from the "mappings.json" file in the same directory. Edit the file and add a mapping for the locale of your newly created language file.
If you add a new language please get in touch with us, so we can add the language to the default list of languages Insight is delivered with.