- This topic is empty.
-
AuthorPosts
-
April 12, 2014 at 9:59 am #168022triplebitParticipant
Here is my site:
http://www.triplebit.com/mystile/
Since my language is Hebrew, I rtl-ed the site.
In the header at the top there is the fields: items450$8
while it should be: 450$ פריטים x (x relates to 8)
The original English site is here:
http://www.triplebit.com/mystile-org/
and the original English fields are so:
120$ x items
Can someone help please?
Regards
TriplebitApril 12, 2014 at 11:53 am #168032Paulie_DMemberCan you not specify a class for that specific element (or group) that returns the styling to LTR?
I confess I know very little about LTR/RTL.
April 12, 2014 at 5:11 pm #168040__ParticipantIn the header at the top there is the fields: items450$8 while it should be: 450$ פריטים x (x relates to 8)
When I look at the site, it says “items 0 $0” —is that the part you’re looking at?
Browsers are smart* with text direction: if they see words that are certainly LTR, they’ll usually put them LTR, even if they’re in the middle of a RTL page. I know it’s coming from a plugin somewhere, but can you get the word “items” translated?
* “smart”, for better or worse (but usually just for frustrating web devs).
edit it may also be a grammar issue. RLT doesn’t change the order of words, just the direction. If the plugin doesn’t know it’s writing hebrew, it might simply be stubbornly putting the words in the wrong place…?
April 15, 2014 at 2:06 pm #168148triplebitParticipantThanks
I ‘ll try to follow your advices. Is it posible to determine whether the source is from a php or javascript file?
Regards
TriplebitApril 18, 2014 at 12:39 pm #168304FerdleyParticipantSo your problem is caused by two issues. Firstly the browser ignores the two containing spans when rendering the text on screen so your text is essentially “450$ 8 items”. The spans only get used to apply CSS. Once you flip the page into RTL, the bi-di algorithm cuts in and now the directionality of the text content determines the screen order. This leads to the second issue that is caused by the dollar sign which is weakly directional character and the number which is strongly left-to-right. When these are all mixed in, the algorithm splits the “1 item” span around the first span.
The fix is very easy – you need to add an LRM (left-to-right marker) (unicode char \u200e) character after the dollar sign which will force the text ordering to consider the two pieces of text as separate parts.
Reference:
Unicode Bi-di algorithm -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.