[fixed]RTL hebrew language bug report and fix

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
mjminfo
Posts: 1
Joined: Sat Jan 22, 2011 9:27 pm

[fixed]RTL hebrew language bug report and fix

Post by mjminfo »

Hi to all, I'm new here so sorry if this is not exactly the good place to ask.

in STK we are having a problem with RightToLeft languages , how they show up.

So Auria as found a fix for that and has submitted a patch, but there is still no news if it has been accepted or not.

https://sourceforge.net/tracker/?func=d ... tid=540678

would it be possible to get an answer as to confirm that it will be included in the next version ?

thank you

jorge
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I don't think anyone on the dev team reads Arabic, Urdu or Hebrew, which makes these things difficult to test. Any chance we could get some test strings with images showing how they are supposed to look, plus a test font? That would make things easier.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Auria
Competition winner
Posts: 120
Joined: Wed Feb 18, 2009 1:11 am
Contact:

Post by Auria »

Ok.

Before my patch :

Image

Uploaded with ImageShack.us

After my patch :


Image

Uploaded with ImageShack.us

You can view the PO file at :

http://supertuxkart.svn.sourceforge.net ... iew=markup

The strings visible in this screenshot are :
msgid "Avoid bananas!"
msgid "Collect blue boxes : they will give you weapons or other powerups"
msgid "Collecting nitro allows you to get speed boosts whenever you wish by pressing the appropriate key. You can see your current level of nitro in the bar at the right of the game screen."
msgid "If you see a button with a lock like this one, you need to complete a challenge to unlock it."
If you wish to test my patch without using STK, you will need to use fribidi in addition to gettext to get proper unicode BIDi support and revert the characters

The test font "Rahel" may be found at
http://supertuxkart.svn.sourceforge.net ... ata/fonts/
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The patch seemed pretty much ok. But folks, get real. Let us at least a few days to check the stuff and maybe also do our daily work. Other patches lurk around on the tracker for years... This one will be commited as early as possible.
Auria
Competition winner
Posts: 120
Joined: Wed Feb 18, 2009 1:11 am
Contact:

Post by Auria »

Sorry for the double post, I found a much simpler way to test. Indeed we can simply fake "RTL English".

I patched the GUI sample :

Code: Select all

Index: examples/05.UserInterface/main.cpp
===================================================================
--- examples/05.UserInterface/main.cpp	(revision 3549)
+++ examples/05.UserInterface/main.cpp	(working copy)
@@ -200,12 +200,30 @@
 	the button in the event receiver.
 	*/	
 
+    const wchar_t* text = L".enigne eht gnilipmocer/gniyfidom fo deen eht tuohtiw ,emitnur ta thcilrrI ot slairetam wen dda ot elbissop si ti ,hguone ton era slairetam"
+    "ni tliub eht fi ,revewoH .slairetam kcab llaf sedivorp enigne eht ,od ot elba ton si erawdrah eht serutaef sdeen hcihw lairetam a gnisu nehw dna"
+    "smelborp tuohtiw enecs a ni slairetam fo sepyt eseht xim ot elbissop si tI .gnireffo si erawdrah d3 syadot (elpmaxe rof slairetam dethgil lexip rep"
+    "xallarap/deppam lamron) enilepip elbammargorp eht no gniyler era emos dna (elpmaxe rof yrtemoeg deppam thgil) enilepip noitcnuf dexif eht no"
+    "desab era slairetam emoS .enigne eht ni elbaliava slairetam ni tliub nommoc fo stol era ereht ,ylkciuq stnemnorivne citsilaer etaerc ot elba eb oT"
+    
+    ".eerf yletelpmoc s'tI :lla fo tseb dnA .no os dna ,aul ,nohtyp ,cisab ,ybur"
+    ",lrep ,avaj rof sgnidnib egaugnal ,srotide ,slairotut ,sreyal dlrow ,sretropxe ,sreredner latrop ,sreredner niarret evitanretla ekil ,bew eht revo lla"
+    "thcilrrI rof stnemecnahne dnif nac uoY .enigne eht esu taht tnempoleved ni stcejorp fo stol era ereht dna ,ytinummoc evitca eguh a tog ev'eW"
+    ".senigne d3 laicremmoc ni"
+    "dnuof eb nac hcihw serutaef tra-eht-fo-etats eht fo lla sah dna ,reredner erawtfos nwo sti dna LGnepO ,D3D gnisu ,mroftalp-ssorc yletelpmoc si tI"
+    ".segaugnal TEN. rof elbaliava osla dna ++C ni elbasu dna nettirw enigne D3 emitlaer ecnamrofrep hgih ecruos nepo na si enignE thcilrrI ehT"
+    "enignE thcilrrI eht ot emocleW";
+    
 	env->addButton(rect<s32>(10,240,110,240 + 32), 0, GUI_ID_QUIT_BUTTON,
 			L"Quit", L"Exits Program");
 	env->addButton(rect<s32>(10,280,110,280 + 32), 0, GUI_ID_NEW_WINDOW_BUTTON,
 			L"New Window", L"Launches a new Window");
 	env->addButton(rect<s32>(10,320,110,320 + 32), 0, GUI_ID_FILE_OPEN_BUTTON,
 			L"File Open", L"Opens a file");
+    
+    IGUIStaticText* txt = env->addStaticText(text, rect<s32>(120,200,600,475), false /* border */,
+                                             true /* word wrap */, NULL /* parent */);
+    txt->setRightToLeft(true); // This is new from my patch
 
 	/*
 	Now, we add a static text and a scrollbar, which modifies the
And don't worry, I'm not pressuring you ;) mjminfo, our Hebrew translator, is just very eager to play STK in Hebrew, that's why he opened a thread here :lol:
Auria
Competition winner
Posts: 120
Joined: Wed Feb 18, 2009 1:11 am
Contact:

Post by Auria »

For everyone's benefit : hybrid merged the patch.

Thanks a lot :)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

*sigh* I guess it's bad style to complain after I didn't work on it for 2 weeks (still fighting with another problem), but I would prefer using an enum not a bool for the layout direction (someone might want top-to-bottom direction next), would anyone complain if I change that again (when I find time on weekend)?

(Also I suppose we need a more general text-formatting and maybe layout class some day, because right now it means this will work for IGUIStaticText, but not for any other place where texts are used, although most of them don't support multiple-lines yet, so I guess it doesn't matter yet too much)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, I guess we cannot support any other direction with the current approach. But having an enum makes the default case also more visible (while it's 'the opposite of right-to-left' now).
Extracting the layout routines would be very nice. But I think most of the GUI classes don't have such kind of re-use anywhere. Which makes me refuse to work on those things usually :wink:
Post Reply