-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Localization
The file msg/messages.js
defines all the messages used by scratch-blocks.
The file msg/scratch_msgs.js
contains all the translations for scratch-blocks. It is generated from translations in the Scratch translation service Transifex.
The tests ensure that the translations are consistent with the definitions. So adding messages or changing message placeholders require developer access to the Scratch project on Transifex.
If you submit a PR that changes messages.js
and you are not a Scratch Team member, the translation tests should fail. Make sure you check the 'Allow edits from maintainers' option on your PR, and then tag a Scratch Team member to push a commit to your branch that includes translations. All the tests other than test:messages
should run correctly before you submit the PR.
New and updated translations from the transifex system need to be checked in as a modification to scratch_msgs.js
.
- Run
npm run translate:update
* - There should only be changes to
scratch_msgs.js
, commit the changes and submit as a PR. - Assuming the only changes are translations, you can merge the PR when the tests pass (it does not need a separate review)
*Note: the translation scripts include validation checks for translations. If there are no translation errors then updating translations is only a matter of minutes. If there are translation errors, then they have to be found and fixed in transifex, and that can be more time consuming.
When languages are added in scratch-l10n, the dependency in scratch-blocks needs to be updated, and the new translations downloaded.
- Branch scratch-blocks from develop into a feature branch called something like "add-francais"
- Run
npm i --save-dev scratch-l10n
to install the new version of scratch-l10n which includes the new languages - Verify with
git diff
or equivalent that the correct version of scratch-l10n is now listed inpackage.json
- Run
npm run translate:sync:translations
to download new translations. Make sure there are translations for the new languages. - Push the branch and create a PR (example: https://github.com/LLK/scratch-blocks/pull/2079/files )
- Review the PR and merge to develop