Add or Remove Languages
Translations files can be added to the project so that your project will be translated automatically depending on the language set in the browser or on the touch screen.
NOTE: As of CH5 version 2.18, the project-config.json file includes a defaultLanguage parameter that will load a default language JSON file for the project based off its specified Unicode locale identifier. The defaultLanguage parameter must be defined at the root level of the project‑config.json file.
For more information on languages and translation files, refer to Languages.
Add a Language
To add translation files for different languages:
- Navigate to app/project/assets/data/translation to access the language JSON files.
- Add a new language JSON file by creating a file name with Unicode locale identifier.
- Open the index.html file and add the title using attribute data-ch5-i18n, which denotes the translation key value.
Example: en.json for English and de.json for German in the app/project/assets/data/translation path.
<h1 data-ch5-i18n="-+page.title+-"></h1>
<p data-ch5-i18n="-+page.description+-"></p>
The language JSON file from the path can be deleted from the app/project/assets/data/translation path.
Remove a Language
To remove a language file, delete the following code from the index.html file:
<h1 data-ch5-i18n="-+page.title+-"></h1>
<p data-ch5-i18n="-+page.description+-"></p>