Setting input direction in UI

I noticed that there has been multiple long conversations about RTL support and each of them have gone many different directions. All and all have added great functionality of the website in RTL languages.

To do a quick recap:

  • Now you can change the locale of the discourse site to one of the RTL languages and the whole site flips the right direction.

  • If you need ocassional LTR posts, you can use <div dir=ltr>...</div> to make sure it’s showing the right direction. And that’s good. Except there’s one key element missing here.

Because of its dominance and adoption, English words and sentences in middle of any RTL language are almost inevitable.

Now there are two ways to tackle this issue:

  1. Make use of a library to detect language direction
    I understand this option has been discussed extensively and because of its complexity, it’s not a priority for the core team until someone offers a patch.

  2. Let users set the direction from the text editing tool bar
    A good example of that is Google docs. I trust others like WordPress and Wikimedia also have the similar option:

    This way, user can easily select a paragraph or sentence and make sure they’re in the right direction.

This can significantly increase the usability of discourse for bilingual users.

5 Likes

This would require quite radical changes, cause the editor is now a single textarea, it would have to become “content editable” or something else fancy to support 1 para in English and a second in an RTL lang.

3 Likes