Skip to content

Localization

Benjamin Wheeler edited this page Feb 7, 2019 · 6 revisions

Overview

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.

Adding languages

When languages are added in scratch-l10n, the dependency in scratch-blocks needs to be updated, and the new translations downloaded.

  1. Edit the package.json to refer to the version of scratch-l10n that includes the new languages.
  2. Run npm i scratch-l10n to install the new version
  3. Run npm run translate:sync:translations to download new translations. Make sure there are translations for the new languages.
Clone this wiki locally