blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Implement formal support for translation of messages in plugins

Open moniika opened this issue 3 years ago • 1 comments

Category Plugins

Component

n/a

Is your feature request related to a problem? Please describe.

Plugins that have translatable text on UI element require translation support, but there is no "official" way to support translation in plugins.

Describe the solution you'd like https://github.com/google/blockly/issues/1169

Describe alternatives you've considered

Continue using the same approach as in block-plus-minus and workspace-backpack plugins: https://github.com/google/blockly-samples/blob/fb16a806ce44aeb5296647f77bbc5813c3b5ed93/plugins/workspace-backpack/README.md#blockly-languages https://github.com/google/blockly-samples/blob/fb16a806ce44aeb5296647f77bbc5813c3b5ed93/plugins/block-plus-minus/README.md#blockly-languages

Additional context The design for this will probably require core changes and existing plugins with english strings should be updated to use the new system.

moniika avatar Jul 07 '21 19:07 moniika

Additional info:

In typed modal we addressed this by allowing developers to call setLocale with a messages object. See 'Blockly Languages` on the npm page.

alschmiedt avatar Jul 08 '21 18:07 alschmiedt