Adding translations with the translate
script
Run this script every time you add or modify uses of ix
The translate
script scans your changes for new strings wrapped in ix
. For every new ix
string detected, it will automatically add the translation into the JSON translation files. This script keeps your translations organized, saving your engineers from having to manage translations manually.
Running the script
Let's say you just added new text in your codebase.x
Whenever you add, remove, or modify text wrapped in an ix
, run the translation script.
$ python3 /i18nix/translate.py
We recommend setting an alias for translate
in your terminal that points to python3 /i18nix/translate.py
, that way you can just run the command translate
.
$ translate
Scan a specific file
Run the following command to scan a specific file. The command assumes using the translate
alias.
translate --file {file_location}