CHT Applications > Reference > translations/
Localization: Localized labels for CHT applications
Apps built with CHT Core are localized so that users can use it in the language of their choice. It is currently available in English, French, Hindi, Nepali, Spanish, and Swahili. The goal of this doc is to help our team manage these and future translations.
Like the rest of our code, the translation files live in our GitHub repo. These translation files are properties files, which are a series of keys and their corresponding values. We use the English file as our default, and as such contains the entire set of keys. If any key is missing from another language file the English value is used.
In order to collaboratively edit the translations we use POEditor.com. Translators can be given access to specific languages so that we can more effectively edit language text to be included in CHT Core. Once the text is ready it can be exported from POEditor to GitHub and included in the next release of our app.
Note that “keys” in .properties files are referred to as terms
in POEditor.
New languages must be added and configured in several places:
messages-XX.properties
file in the api/resources/translations
folder, replacing XX with the 2 or 3 letter language code.LOCAL_NAME_MAP
in api. Use the language code for the key, and the local name followed by the English name for the language in brackets, eg: “fr: ‘Français (French)’”.In order to trace the addition of new terms and also updates to existing translations, the default translation file (messages-en.properties) must be updated directly. Our GitHub repo provides with a command line tool (CLI) to import updates into the POEditor app. If you don’t have an API token, please contact a Medic developer. Please do not disclose this API token to anyone else.
All text in the app is internationalised.
<h3 translate>date.incorrect.title</h3>
.Because help pages are too large to manage easily through the standard translation mechanism, and we want to include lots of markup, help pages are translated by providing md documents for each language. This isn’t yet up and running so ask for help.
Much of the app is configurable (eg: forms and schedules). Because the specifics of the configuration aren’t known during development time these can’t be provided via messages. Instead we allow configurers to provide a map of locale to value for each translated property. Then use the translateFrom
filter to translate from the configured map using the user’s language.
To be done only by updating messages-en.properties, importing to POEditor through the CLI tool and updating the other language translations through the POEditor app.
To be done only by updating messages-en.properties and importing to POEditor through the CLI tool.
To be done only by exporting all translations through the CLI tool. If you don’t have an API token, please contact a Medic developer. Please do not disclose this API token to anyone else.
Localization: Localized labels for CHT applications
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.