-
-
Notifications
You must be signed in to change notification settings - Fork 191
Handling languages, locales, and translations
Locale files for each platform are generated during the build process. The final messages.json
file (or messages.properties
on Firefox) is generated when _locales/en/messages.json
and _locales/en/adnauseam.json
are merged (via jq
, called from tools/make-locales.sh
). Though automatically triggered when building, you can also run this script on its own as follows:
$ tools/make-locales.sh [/path/to/output/files]
We sometimes manually update the locale file _locales/en/adnauseam.json
in Github. When this happens we also need to update all our translations to include these edits or additions, which we do through Crowdin.
Note: the English version of_ adnauseam.json _is the ONLY locale file that should ever be edited directly in the repo!
The English adnauseam.json
file can then be uploaded as the source on Crowdin for public translations (step 1 below)
Our workflow for updating translations is as follows (assumes Crowdin Manager permission):
- Sync the English version of
adnauseam.json
on Crowdin with the one from the repo (see image below) - Approve new and updated translations found on Crowdin
- Build the Crowdin project so that it contains only the latest approved translated strings
- Download and unpack the latest Crowdin zip archive (to
~/Downloads/adnauseam
by default) - Run the following command from root of ADN to update the (non-english) locale files in our source.
$ tools/import-adn-crowdin.sh
- Check one or more translated languages (e.g.,
_locales/zh_CN/adnauseam.json
) to verify that they contain the latest updates - At this point, building for any platform will merge each updated 'adnauseam.json' file with the existing
messages.json
into a single file for each locale in the generated extension.
Screenshot for updating source adnauseam.json
: