Skip to content

Commit e06f13d

Browse files
fix: add documentation about locales for colour blocks (#2452)
* fix: add documentation about locales for colour blocks * chore: format
1 parent 07b745c commit e06f13d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

plugins/field-colour/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,25 @@ colourBlend.installBlock({
280280
});
281281
```
282282

283+
#### Message files and locales
284+
285+
The blocks in this package contain text that can be
286+
[localized](https://developers.google.com/blockly/guides/create-custom-blocks/localize-blocks)
287+
into multiple languages. As of August 2024, the relevant messages are
288+
included in the core Blockly language files.
289+
290+
If your blocks show `%{BKY_COLOUR_BLEND_TITLE}` or similar text instead
291+
of the expected text, make sure that you either:
292+
293+
- Import the [default Blockly modules](https://developers.google.com/blockly/guides/configure/web/translations#import_blockly_default_modules),
294+
which includes the English langfiles, or
295+
- Explicitly [import a language](https://developers.google.com/blockly/guides/configure/web/translations#import_blockly_languages)
296+
and call `setLocale` before using these blocks.
297+
298+
For more information on Blockly's approach to localization, see the
299+
[Localize Blocks](https://developers.google.com/blockly/guides/create-custom-blocks/localize-blocks)
300+
developer guide.
301+
283302
### API Reference
284303

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

0 commit comments

Comments
 (0)