Support and General Use > Theming and Appearance Customization
wps/sbs issue with tags in rtl languages
biengo:
Hi,
I'm trying to implement proper rtl language support in my theme. My problem is, that while metadata tags in ltr look just right, e.g. "Tag_in_ltr:Next Track", with tags in rtl such as hebrew the order gets flipped around. It now prints "Next Track:Tag_in_rtl". I can rearrange the code only to make it right for ltr or rtl tags, but would like to cover both cases.
the code is:
--- Code: ---%?Sr<%aR%t(3)%s%?it<%it|%fn> :%Sx(Now Playing);%aR%t(3)%s%?It<%It|%Fn> %Sx(Next Track:)|code for ltr languages>
--- End code ---
I hope the attached screendumps illustrate the issue better.
JdGordon:
You're asking for a check if the actual tags is ltr or rtl instead of the system language? I don't tihnk that is really possible.
biengo:
I just thought the order of the tags would not be rearranged with regard to rtl or ltr script, so that If I wrote for ?%Sr<rtl
--- Code: ---%It %Sx(Next Track:)
--- End code ---
it would always be readable from right to left, whether %It is latin or hebrew (See attached snippets).
To me it seems that if the interface language is rtl and the tag language is rtl text direction is reversed to ltr again.
I find it kind of hard to wrap my head around this and I'm beginning to think this is a case that would require complex text layout capabilities to be handled properly... I'll just pick one script to look right then. Thank you, JD!
JdGordon:
Ah, I see what you're saying...
I'd say this is a real bug but I have no idea how the text drawing actually works (I'll try and get someone who does though)
for the benefit of those who cant read hebrew and are not sure of the problem either, the problem is the text line has two parts... <a> and <b>. the skin code suggests that <a> should always be drawn left of <b> (or right in this case because Hebrew is LTR so left and right are switched). The problem apparently is that when <a> is LTR and <b> is RTL the order is mangled.
Actually I'm really confused because the top line (to me) is the correct placement (with the Hebrew on the right) and the bottom image is backwards. (the second image would be the equivalent of "happy birthday Next Track:" in English (where obviously you'd expect it to be "Next Track: Happy Birthday".
blengo: a relatively simple fix would be to put both parts of that line in separate viewports, but I think this is a real bug and should be reported on flyspray
fml2:
What happens if you just do it like this:
--- Code: ---%?Sr<%aR%Sx(Next Track:) %?it<%it|%fn>|code for ltr languages>
--- End code ---
I think the text drawing engine should handle all this correctly.
IIUC, the engine works so that first a line of text is formed in memory and then it gets rendered. The rendering engine works similar to a typing app that can handle LTR and RTL texts.
I can't try it myself right now.
Navigation
[0] Message Index
[#] Next page
Go to full version