Handle RTL text (#1702)

* Handle RTL text

Fixes issues related to dropdown menus (right align instead of left align), and bi-directional blocks (e.g., go to x: %1 y:%2, the ‘x: %1 y:%2’ is LTR, but should not be treated as LTR, when rendered in Hebrew it should be ‘%2 :y %1 :x’)

* Set dropdownDiv direction

Set the direction based on the rtl of the block that owns the menu.

Note the css for dropdowns is completely different from blockly (`float` vs `absolute`) as a result of this PR from a couple of years ago: https://github.com/LLK/scratch-blocks/pull/632/

*  use right-left-embed (rle) unicode to force RTL text, and left-right-embed for editing numbers.
This commit is contained in:
chrisgarrity 2018-08-30 14:05:25 -04:00 committed by GitHub
parent b537fc4b99
commit 30a6e67ffa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -1182,7 +1182,7 @@ Blockly.Css.CONTENT = [
'.blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {',
/* Flip left/right positioning. */
'float: right;',
'margin-left: 6px;',
'margin-right: -24px;',
'}',
/* Keyboard shortcut ("accelerator") style. */