In this documents
- Please make sure you have done
npm install
. - Install
Homebrew
byruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install and follow the instructions here: https://support.crowdin.com/cli-tool/#installation
- Important: Please use version 3 of the crowdin cli-tool
- Get Crowdin API Key and add this line to your .bash_profile:
export CROWDIN_API_KEY='put API Key here'
IMPORTANT! This key gives full access to all your Crowdin project data. Treat this just like a password and never push it to any public repo.
- Simply run
./scripts/update_translations.sh
in root folder of project to do these tasks:
(It is possible to confirm/skip each task by answering y/n to questions, only the first one is mandatory):- Check out and update the translations branch
- Update master and merge into translations
- Update the source file (
messages.pot
) and push it to Crowdin - Download translation files from Crowdin to
src/translations
and update javascript textssrc/javascript/_autogenerated/[LangCode].js
- Commit changes and push to origin
- Open Github to submit the PR
Texts that are used in js code will automatically be extracted during the translation update process (3rd step above: Updating the source file).
In order to make sure that no strings are missed by the extractor code while pushing to translations, please:
-
Refactor the code so that the first argument passed to the
localize()
method is a string literal. i.e.const text = localize(is_started ? 'Sell at market' : 'Sell');
would change to:
const text = is_started ? localize('Sell at market') : localize('Sell');
-
If there is no way to have the string literal in js code (i.e. API texts which are not translated), add them to
scripts/js_texts/static_strings_app.js
.Note: Regarding API texts, even if the string is translated automatically somewhere else we should still include it here to avoid missing it if that other string gets removed.
-
At the end, when you're sure that a string has already been taken care of, just put this comment
/* localize-ignore */
right after the first argument oflocalize()
call to ignore it from tests.
js_texts:
├── extracted_strings_app.js
└── static_strings_app.js
extracted_strings_app.js
: Contains extracted strings. It's for debugging purposes only and shouldn't be changed manually.static_strings_app.js
to handle those strings that don't exist in js code. e.g. API texts that are not localised, etc.
During the translation update process, the source file messages.pot
will be updated with all texts from both the above files.
- The list of paths to include in
sitemap.xml
is here: config/sitemap_urls.js - Once the paths are updated in the above file, run
./scripts/sitemap.js
orgrunt shell:sitemap
to generate newsitemap.xml
files insrc/root_files
according to each section.