GNOME Bugzilla – Bug 439415
"calculator" interface should not be RTLed for Hebrew locale
Last modified: 2007-07-22 06:15:17 UTC
Please describe the problem: Seems like the interface uses standard GTK box container, so it is automatically reversed and right aligned when running in RTL locales. However, all calculators available in Israel have the same ui as any other english calculator. In particular, The numbers order are never reversed in Hebrew. Thats true for calculators, phones and keyboards. Therefor it is confusing and painful for the Hebrew speaker to use gcalctool in the Hebrew locale. Note that the Menu interface is just fine and shoul keep its right alignment. I'm not sure if this issue is relevant for all RTL locales (Comments needed), thus it is possible to add a flag to decide the calculator ui direction (default to LTR) that will be translated in the language .po file. If we can agree of the .po files way to decide the calculator interface direction, i will start working on a patch. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
I had a quick look at this. Perhaps the easiest way to do this is to have a command line option (say -r) for gcalctool that indicates that the calculator display should be reversed. That would be detected in the get_options() routine in get.c (about line 134). If found, then a variable would be set (say v->display_reversed). This is defined in the calcVars struct in calctool.h It's initial value would be defined in the init_vars() routine in get.c (about line 245). The actual contruction of what's displayed in the calculator is in set_display() in gtk.c (about line 3270) and write_display() in gtk.c (about line 3334). The second one is used only once in "expression" mode, in refresh_display() in display.c (about line 626). I'm not totally sure why there needs to be two routines. Adding Sami to the cc. Hopefully he can answer this. Another routine that might have to be potentially altered is: gtk.c:get_display() (line 2045)
Created attachment 88487 [details] Screen capture of issue I'm not sure we are talking about the same thing. Just to make sure i've attached screenshot of gcalctool in RTL mode. The blue circled area is what I refer to as Calculator UI. The red circled area is what I refer to as Menu UI. Are we cool with that?
You're right, we weren't talking about the same thing. I was actually thinking you meant the bit you haven't circled in color. The display area in between. Okay, I'll let you drive. ;-) Just let me know if I can help in any way. Thanks.
The same is true for Arabic. In fact, it's probably true for every user interface that resembles real life equipment such as scanners, printers, calculators, keyboard key placement, etc.. I would think fixing this is just a question of using gtk_widget_set_direction (sp?) on the container widget.
Thinking of it, do we reverse the numpad only or the whole interface? I'm leaning towards reversing the whole interface.
I'm in for changing the whole interface, just like a real calculator looks like.
I agree with Yair. Keypads should not be inverted. The easiest way to fix it is to gtk_widget_set_direction() on the involved container.
Created attachment 90968 [details] [review] set direction for calculator boxes toLTR
pretty simple. it still need to be verified that i've covered all relevant containers.
Yair, when you are happy with this patch, please feel free to just go ahead and commit it. Or let me know, and I'll be happy to do it for you. Thanks!
Commited. 2007-07-22 Yair Hershkovitz <yairhr@gmail.com> * gcalctool/gtk.c: Always use left-to-right direction for button's boxes. Fixed bug #439415.