This doc is for maintainers or for people who want to setup a similar translation process with a copy of the trustlines app.
The Trustlines App uses the localization framework FBT and the translation platform Crowdin for supporting different languages. The utility scripts in
/translation/scripts are used for enabling smooth integration of the mentioned tools. The scripts
splitTranslation.js are copied from the Origin Protocol mobile app repository and modified to our needs. The respective license can be found in
Before being able to start the translation flow, make sure you did the following:
- Install Crowdin CLI tool.
- Create a
crowdin.ymlfile by copying or renaming
crowdin.yml.distand set your
api_tokenthere. The values can be found on the Crowdin platform.
yarn translate to execute the whole translation flow. The command combines the following steps:
yarn fbt:manifest: Generates FBT enum and source manifest files ->
yarn fbt:collect: Collects FTB translatable strings from source files ->
yarn fbt:crowdin: Runs
node translation/scripts/fbtToCrowdin.jsand converts
.source_strings.jsoninto simple key-value json readable by Crowdin ->
yarn crowdin:upload: Runs
crowdin upload sourcesand uploads all source files under
yarn crowdin:download: Runs
crowdin downloadand downloads all available translations files from Crowdin into
yarn crowdin:fbt: Runs
translation/scripts/crowdinToFbt.jsand converts respective
translation/crowdin/translations/all-messages_<language>.jsonfiles to FBT-readable files in
yarn fbt:translate: Combines translations in
yarn fbt:split: Runs
.translated_fbts.jsoninto respective translation files in
yarn crowdin:mdjson: Runs
translation/scripts/mdToJson.jsand merges all markdown files in
translation/crowdin/translations/mdto a consumable JSON file in
You can also run steps 1 - 4 separately from steps 5 - 9.
yarn translate:upload: Runs steps 1 - 4.
yarn translate:download: Runs steps 5 - 9.
If you want to override any of the .md files just create a copy of the file and change the .md extension to .override.md. Afterwards
yarn crowdin:mdjson this will read all .md files and will override the translation from the original file with the
content in the .override.md file.