RTL Mode in LTR languages

136 views
Skip to first unread message

Austin Ayers

unread,
Jul 1, 2015, 2:56:01 PM7/1/15
to blo...@googlegroups.com
Hi,
I want my Blockly application to be in RTL mode, as it makes more logical sense for it to be that way for the program. The only problem with having Blockly in RTL mode when using a LTR language (I'm using English) is that any text-editing inputs are graphically odd. Any keyboard input starts on the left (as any RTL language would be) then quickly gets flashed to the right, in the correct place. The caret input (the flashing bar or underscore that appears in word processors) is on the left side of the text input instead of on the right side. Is there any way to change RTL mode so that the blocks maintain their RTL qualities, but have any text input be in LTR?

Namely, is there a way to do RTL mode for LTR languages without the above problem occuring?

______________________________________________

Example: (  "|"  <---   represents the caret  )

"This is my inp|"    -- LTR text editing


"|This is my inp"    -- RTL text editing

______________________________________________

Thanks,
Austin Ayers

Neil Fraser

unread,
Jul 1, 2015, 3:00:19 PM7/1/15
to blo...@googlegroups.com
Maybe change this line in widgetdiv.js:
  Blockly.WidgetDiv.DIV.style.direction = rtl ? 'rtl' : 'ltr';
to:
  Blockly.WidgetDiv.DIV.style.direction = 'ltr';

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Austin Ayers

unread,
Jul 1, 2015, 3:05:39 PM7/1/15
to blo...@googlegroups.com, ro...@neil.fraser.name
I tried it, and the text editing still seems to be behaving the same way.

Neil Fraser

unread,
Jul 1, 2015, 5:40:29 PM7/1/15
to blo...@googlegroups.com
Odd, it works for me.  Did you remember recompile (or try it in test/playground.html)?

Albenur Michelange

unread,
Jul 2, 2015, 12:56:37 AM7/2/15
to blo...@googlegroups.com
Hello I need help plz. I have a blockly to auto count but he cant work can you help me plz.

this is the pictures help me to correct it plz.







plz help me to correct it.

Austin Ayers

unread,
Jul 2, 2015, 11:54:00 AM7/2/15
to blo...@googlegroups.com, ro...@neil.fraser.name
I didn't run build.py, I think that's why. Thanks for the help!
Reply all
Reply to author
Forward
0 new messages