From f3d978d5536f95492665308478e787a41a761335 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 30 Oct 2019 09:53:36 -0700 Subject: [PATCH] Add an RLM after Flyout button text for RTL languages (#3366) * Add an RLM after Flyout button text for RTL languages --- core/flyout_button.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/flyout_button.js b/core/flyout_button.js index 700933a06..84898cf37 100644 --- a/core/flyout_button.js +++ b/core/flyout_button.js @@ -152,7 +152,12 @@ Blockly.FlyoutButton.prototype.createDom = function() { 'text-anchor': 'middle' }, this.svgGroup_); - svgText.textContent = Blockly.utils.replaceMessageReferences(this.text_); + var text = Blockly.utils.replaceMessageReferences(this.text_); + if (this.workspace_.RTL) { + // Force text to be RTL by adding an RLM. + text += '\u200F'; + } + svgText.textContent = text; if (this.isLabel_) { this.svgText_ = svgText; this.workspace_.getThemeManager().subscribe(this.svgText_, 'flyoutText', 'fill');