top | item 37990666

(no title)

obahareth | 2 years ago

I'm bilingual and frequently use English and Arabic together.

What I'm used to is that the caret is unchanged.

The best setup I've seen out there is web browsers with dir set to auto and using properties like padding-start instead of padding-left.

If I start a block with an LTR character the content is automatically left-aligned and vice versa.

The annoying issue comes up when you have bidi characters in the middle of RTL (e.g. Comma or exclamation mark), all tools I've currently seen just break, I have no idea where the cursor is, or where it will move to when I press my arrow keys. I would prefer that bidi characters are treated the same way as the paragraph or block they're in.

I wrote an article a while back with some GIFs that showcases these difficulties:

https://blog.prototypr.io/the-case-of-the-jumping-dot-17f97a...

I've not found any software that gets it all right when it comes to mixed direction content, but for RTL-only then most of the popular word processors (e.g. Google Docs) are quite good with some tweaking.

Happy to chat more on this.

discuss

order

java-man|2 years ago

Thank you for your response!

It looks like you are mostly dealing with the browser, right? Things might have changed since you wrote it in 2017: I see Chrome on macOS do the "right thing" when typing Arabic, the punctuation gets inserted to the left of Arabic. I am using codepen RTL TextArea example which has

   <div dir="rtl"><textarea /></div>
The browser seems to use "logical" navigation in this case, that is, if I place the caret in the middle of digits (1234567) and press RIGTH key the caret moves left.

Do you use any software specifically designed for Arabic market?

obahareth|2 years ago

Yeah browsers are much better at this but there's still a lot of places where it's problematic (e.g. Visual Studio Code, Sublime Text, etc.)

In terms of text editing no not really, most folks I know are either using Word, Pages, or Google Docs.

Usually the caret going the opposite direction is because of bidi characters. It would behave properly if you used Eastern Arabic / Indo-Arabic numerals, e.g. ١٢٣٤٥٦٧٨٩ because those count as RTL.

If you need to have on line that has both RTL, bidi, and LTR, that's when I find everything goes to hell no matter what software I am using.