Skip to content

Update Blockly.Msg system to work without reinjecting the workspace #1895

@AnmAtAnm

Description

@AnmAtAnm

Problem statement

If Blockly.Msg is updated without refreshing the page, new blocks with dropdown fields do not reflect updates.

Expected Behavior

New blocks (with new Field instances) should reflect the latest version of Blockly.Msg. This should allow an app to save a workspace to XML, update the Blockly.Msg string table (i.e., load a new language localization), and reload the workspace from XML with the string changes / language updates.

Actual Behavior

Dropdowns in new blocks retain the Msg string from the time the first block is defined.

Steps to Reproduce

TODO: We have no easy framework that demonstrates live updates to Blockly.Msg.

  1. Create block with a dropdown that contains a static options list of %{BKY_...} strings (e.g., logic_boolean).
  2. Update one of the referenced strings in Blockly.Msg (e.g., Blockly.Msg.LOGIC_BOOLEAN_TRUE = 'Hello!').
  3. Create a new instance of the block. Note the option sting label has not changed in the dropdown UI.

Compare how other fields respond. For instance, load a not block after Blockly.Msg.LOGIC_NEGATE_TITLE = "Hello %1"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions