Set direction of text depending on text itself

pr-welcome

(Quenten) #1

Facebook has it !

When Writing with an RTL language the ticker goes to the other way which gives a very intuitive experience.

I need this for my community because we are bilingual.
Thanks Discourse … Love


Recommended way to handle RTL mixed with LTR languages
1 forum for multiple languages or 1 forum per language?
(Quenten) #2

@codinghorror, Hi Jeff, do you think this is something we can have in the short term ?


(Sawood Alam) #3

Have a look at an old topic here about RTL support.

There is a library that automatically sets the direction of each paragraph based on the content.


(Jeff Atwood) #5

Sure, submit a pull request with the work if you want it. This is how open source works.


(Hosein Naseri) #6

Is there any update for this feature? I desperately need it.

Even if there is a button to change direction of text, when we write english/arabic/persian, would be great.


(Sam Saffron) #7

I just added #pr-welcome on this, hopefully a bilingual developer looking for a contribution will look at this one day.


(Hosein Naseri) #8

I just found that there is an html5 tag dir=auto that simply works in most situations.

For example I wrote this html

<html>
<body>

<p dir="auto">Write this جمله چپ به راست text left-to-right!</p>

<p dir="auto">این RTL sentence  جمله را از راست به چپ بنویس</p>

</body>
</html>

And pasted it in a simple html editor and it works perfectly fine

Could we use the same thing in discourse @sam?


(Hosein Naseri) #9

btw I tried dir="auto" with firebug on <p> tags in discourse. However it didn’t do anything. I don’t know why.