RTL support


(Sirotnikov) #1

While I can type in hebrew and it be ok, it is aligned left. Of course when I add in mixed hebrew-english paragraphs, it goes makes order incoherent.

this is an english paragraph שלום with some עולם hebrew in it.

זה משפט בעברית עם hello קצת מילים באנגלית world בתוכו.

The first one is ok. The 2nd one does not read properly


בדיקה בעברית עובד? כן!
Set direction of text depending on text itself
(Waleed Khan) #2

Not being able to read Hebrew, what’s the expected behavior?


#3

Well, judging from the title, its a css bug affecting right-to-left languages. Who’s working on localization?


(Sam Saffron) #4

Mixing hebrew with english is going to very difficult. What we probably want is an RTL option for the entire UI with hebrew translations. Its a massive undertaking.


(Itsadok) #5

Even if you translate the entire UI and switch the layout to RTL, you’re still going to have a problem as soon as someone writes a paragraph in English.

To fully support RTL, you need to have a way to specify, per paragraph, whether it’s RTL or LTR. This is a feature missing from markdown, and not really available as a unicode directive (in HTML, you’re supposed to use the “dir” attribute).
What you can do, is detect the directionality of the first (directional) character in the paragraph and set the dir attribute of the generated paragraph appropriately. It’s a simple solution for 99% of the cases. For example, this is what Google does in their search bar and in Talk.


(Sam Saffron) #6

Open to a patch in this area provided it does not regress other parts


(Itsadok) #7

It looks like somebody did most of the hard work already. I’ll try to turn that into a pull request when I have some time.


(J.A.) #8

This will probably need a lot of work.

Just compare the interface of the English Wikipaedia with the interface of the Jewish Wikipaedia. It took the Wikimedia Foundation years to get to this stage. For a small start-up like CDCK, this is too much work for too small a gain. For now.

Still, you can create an issue for it if you don’t mind it lying dormant for a few years.


(Itsadok) #9

First of all, this is a Jewish “wikipedia”, you just linked to the Hebrew wikipedia. Sorry for nitpicking, you just made me do a double take.

Second, there isn’t really much of a difference between the Hebrew and the English interface. The direction is flipped, and the labels are translated, The editing (non) interface looks the same (English, Hebrew). They didn’t even bother adding paragraph direction buttons, probably since you’re not expected to add any LTR paragraphs in the Hebrew wikipedia.

Anyway, I think we can all agree with Sam’s assessment that having a fully Hebrew interface would be a massive undertaking, and definitely should come after the German, French and Spanish translations. This is not what was requested here, and it’s not what the showdown fork I linked to was about at all.

This is simply about properly detecting and displaying RTL paragraphs regardless of the general direction and language of the rest of the web page. Like I said, it’s a relatively simple change that can help RTL text be more readable in Discourse.

Frankly, though, I can’t think of a real use case for writing Hebrew posts in an English forum, so unless someone has an idea where it could be useful, I’m going to drop the subject for now.


(Sam Saffron) #10

Please don’t drop it, I would love to see showdown improved to support this, I know @balpha is interested in it as well seeing they run a (for realz this time Jewish Stack Exchange) I have a soft spot for Israeli forums, the software used there in general reaches some unprecedented levels of suck due to the complex nature of RTL, that and I spent my youth in Israel, so any translations or work in the hebrew front could easily be validated by me. Its the only other language except for English I could help localize.


(Itsadok) #11

…and there’s my use case. That was quick. :slight_smile:


(meseznik) #12

Hi everyone,

From my experience with flipping designs to RTL, the biggest problem is with complex UI that involves JS. If it’s only CSS, then the solution is quite simple and doesn’t involve much maintenance (small script that flips all the styles/Google Closure).

Twitter tackled this recently:
About.

WordPress has RTL support for quite some time (since 2004 -wikipedia). Maybe it’s worth consulting with the two guys who were maintaining it?

Even if you’ll choose not to support it at this time, I believe you should check this thoroughly so support in the future won’t be compromised.

BTW, it’s worth noting that RTL will support both Hebrew AND Arabic.


(Ronny Orbach) #13

Most of the “flipping” work can be done automatically, and some things require manual intervention (usually some of the graphics). Other than that, there’s the text-direction challenge, which like people noted here, have been solved by Facebook, Wordpress and more.

I believe that’s the first thing to solve. Other direction-related stuff can wait, as flipping or overwriting styles later isn’t too hard.

p.s.
I co-founded the Hebrew edition of phpBB in 2002 and we still maintain the project today.


(Amr Eldib) #14

I’m interested in helping provide Arabic translation. What’s the decision on providing RTL support? Can the software work with Arabic on LTR?


(Sam Saffron) #15

I guess, the decision is that we REALLY want it, I think someone like @RonnyO would be the ideal person to work on the infrastructure changes needed.

At the moment the core team is a bit snowed under, we can not help much with the implementation of the architecture yet, but can help with guidance.


(Ron Gross) #16

+1 for this feature.

I would love to use it for the Hebrew Bitcoin forum. Right now the discussion is scattered among a Google Group and a Hebrew section of the world Bitcoin forum, both of which are sub-optimal.


(Ali Ismail) #17

Hi Amr,

I am already working on the Arabic translation. If you like we can work on it together.

I created a public project on crowdin.net, so you should be able to join it

Project link: Log In - Crowdin


(Amr Eldib) #18

That’s excellent. Thanks @Ali76
But I think you should try to use GitHub. That way you’ll be able to do a pull request and submit the translation directly into the Discourse source code.


(Ali Ismail) #19

true, but at first we should finish the translation then we can do a pull request on github.

crowdin.net simplify and accelerate the translation process, especially if the work we will done by many persons.


(Waqas Ahmed) #20

Hey, once you do the Arabic translation and tackle the RTL issue (which is indeed tricky) i can just translate Arabic to Urdu, which is also RTL. However, what are you going to use to input arabic, hebrew or urdu text? Google’s Transliterate (now input tools) can be a good option. I dont know about arabic or hebrew but for Urdu it is probably the only option because this language doesnt have a lot of support/keyboards and OSs dont support urdu input natively.