mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
PR #818: Adding support for string table lookups in dropdown field labels
Adding support for string table lookups in dropdown field labels specified in JSON. Adds Blockly.utils.replaceMessageReferences() method to handle string replacement without interpolation tokens. Effectively uses the same old code, now moved into tokenizeInterpolation_(), which takes a parseInterpolationTokens option. Replaces the direct JavaScript references (not pure JSON, and thus not portable). Demonstrating this behavior in the logic_boolean dropdown.
This commit is contained in:
committed by
GitHub
parent
35d83a576f
commit
ac3df2759c
@@ -445,8 +445,8 @@ Blockly.Blocks['logic_boolean'] = {
|
||||
"type": "field_dropdown",
|
||||
"name": "BOOL",
|
||||
"options": [
|
||||
[Blockly.Msg.LOGIC_BOOLEAN_TRUE, "TRUE"],
|
||||
[Blockly.Msg.LOGIC_BOOLEAN_FALSE, "FALSE"]
|
||||
["%{bky_logic_boolean_true}", "TRUE"],
|
||||
["%{bky_logic_boolean_false}", "FALSE"]
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user