Skip to content

Commit

Permalink
fix: add documentation about locales for colour blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-fenichel committed Aug 28, 2024
1 parent 6b36d8b commit 9634646
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/field-colour/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,25 @@ colourBlend.installBlock({
});
```

#### Message files and locales

The blocks in this package contain text that can be
[localized](https://developers.google.com/blockly/guides/create-custom-blocks/localize-blocks)
into multiple languages. As of August 2024, the relevant messages are
included in the core Blockly language files.

If your blocks show `%{BKY_COLOUR_BLEND_TITLE}` or similar text instead
of the expected text, make sure that you either:

- Import the [default Blockly modules](https://developers.google.com/blockly/guides/configure/web/translations#import_blockly_default_modules),
which includes the English langfiles, or
- Explicitly [import a language](https://developers.google.com/blockly/guides/configure/web/translations#import_blockly_languages)
and call `setLocale` before using these blocks.

For more information on Blockly's approach to localization, see the
[Localize Blocks](https://developers.google.com/blockly/guides/create-custom-blocks/localize-blocks)
developer guide.

### API Reference

- `setColours`: Sets the colour options, and optionally the titles for the
Expand Down

0 comments on commit 9634646

Please sign in to comment.