Partial fix Mixed usernames with RTL and LTR charecters

I'm tempted to say that things like this should be handled in the translation/phrases themselves -- the correct RLM would need to be inserted after the usernames (or comma, as that's the weak character). This does potentially come up in any "sentence" based structure (recent activity, etc).
 
This is how the translation looks like:
{user1}, {user2} ו-{user3} אוהבים את זה.

{user1}
Should be first as in RTL. There are no commas before a third (or last) item in Hebrew (in English it depends on the writing style, but in Hebrew it's totally incorrect).
 
I'm tempted to say that things like this should be handled in the translation/phrases themselves -- the correct RLM would need to be inserted after the usernames (or comma, as that's the weak character). This does potentially come up in any "sentence" based structure (recent activity, etc).
Maybe a new string helper?
Something like
PHP:
{xen:string rlm, {xen:phrase x_y_z}}

Which will add ‏ after each comma.
 
So after a load of research, the proper way to solve this involves the <bdi> tag, which has minimal support (no IE, AFAIK). The goal is to isolate the individual elements in terms of the bidi algorithm. (There's also a unicode-bidi CSS option, though it's not targeted at designers.)

There's also a new direction="auto" attribute which may work (it uses the first strong character to detect the direction, which could possibly be incorrect but I suppose it's no worse than what we have right now. This might be the easiest thing to check as it doesn't change any markup (in the <xen:username /> case).

There are potentially a lot of cases where this needs to be inserted though, I think.
 
Back
Top Bottom