• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Partial fix Mixed usernames with RTL and LTR charecters

Mike

XenForo developer
Staff member
#3
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).
 

Moshe1010

Well-known member
#4
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).
 

rellect

Well-known member
#5
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.
 

Mike

XenForo developer
Staff member
#6
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.