4.1.2.5.3 Custom Localization

The custom language settings help you use the translations in the application that are not part of the application packet. Use JSON strings for language settings.

The user translation texts are optionally saved in the translationMap.json file in an external storage (physical or emulated SD card) with the following path: 

/sdcard/hipmo-localization/translationMap.json.

The hipmo-localization folder is automatically created on the first available SD card upon the application start. If there are multiple SD cards in the device or you do not know which to use, you can verify upon start on which SD card the folder was created.

Caution

Make sure that the file name format is translationMap.json, i.e. do not add any (language) extensions or insertions. For example, translationMap-cs.json is incorrect.

Text file structure

JSON with user text translations contains root element data, which is the field of translation elements:

{"data":[
 translation,
 translation,
    ...
 translation

]}

Each translation element has the following structure:

{"key":{"hint":"hint_string","value":"translated_string"}}

where

  • key – is the text string key (substitutes name in strings.xml)
  • hint_string – is the meaning of the text 
  • translated_string – is the user text translation

Example:

{"title_call_declined":{"hint":"Call declined","value":"Call declined"}}

We recommend you to edit just translated_string; hint_string can be edited only if useful. 

Warning

You are not recommended to edit KEY to avoid unpredictable behaviour of the application.

The application checks whether there is a file in the asset that matches the current Locale setting in the device. If so, the application adds the set keys to the map. If the keys are identical, the old values are replaced with new ones.

The application verifies the Custom Localization switch state in the configuration. If the function is enabled and there exists an appropriate user translation file in the device, the application adds the set keys to the map as mentioned above.

Caution

Untranslated strings are displayed in the English language.