Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: execution steps for i18n sync script

...

This documentation page has been updated to reflect that the language catalogs have moved from /resources/i18n to /src/assets/i18n and that sync-i18n-files.js has now become a typescript file.

Instructions to start the script have been updated.

TODO update the documentation at Localization L10n

...

2. Preload your new catalog with all the messages in the en.json5 catalog by executing the sync-i18n-files.js ts script, for which you can find more detailed documentation lower on this page. Assuming you are in /src/resourcesassets/i18n, you can execute:

Code Block
yarn run sync-i18n -s en.json5 -i -t fr.json5OR
ts-node --project ../../../tsconfig.ts-node.json ../../../scripts/sync-i18n-files.jsts -s en.json5 -i -t fr.json5

where en.json5 is the "source" language file where the original keys will be retrieved, and fr.json5 is the catalog of the new language for which you want to start a translation. If you receive an the error that environment.ts can not be found, try running "yarn run config:dev" before you execute the sync-i18n-files script.

The file should now be filled with all of the English messages, that are now present both as comments, as well as message, for you to translate.

...

Please run the node script: /scripts/sync-i18n-files.ts.

There are two ways to run this script:

  • yarn run sync-i18n
  • ts-node --project ../../../tsconfig.ts-node.json ../../../scripts/sync-i18n-files.

...

  • ts ==> assuming that you execute this while you are in /src/assets/i18n

The results of your changes will be reflected in the catalogs of the other languages, so translators can pick up the work to:

...

By default, the execution of sync-i18n-files.js ts will:

  • look at en.json5 as the authoritative source file
  • will look at all catalogs present in /src/resourcesassets/i18n/ as target files to sync up with the latest changes in source.
  • will execute these changes in-place, meaning that no backup etc is taken of the translation before the sync

...