After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 439415 - "calculator" interface should not be RTLed for Hebrew locale
"calculator" interface should not be RTLed for Hebrew locale
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.19.x
Other All
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks: Hebrew
 
 
Reported: 2007-05-18 13:13 UTC by Yair Hershkovitz
Modified: 2007-07-22 06:15 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Screen capture of issue (10.59 KB, image/jpeg)
2007-05-20 13:49 UTC, Yair Hershkovitz
  Details
set direction for calculator boxes toLTR (1.52 KB, patch)
2007-07-01 14:19 UTC, Yair Hershkovitz
none Details | Review

Description Yair Hershkovitz 2007-05-18 13:13:01 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:
Comment 1 Rich Burridge 2007-05-18 15:01:00 UTC
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)


Comment 2 Yair Hershkovitz 2007-05-20 13:49:04 UTC
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?
Comment 3 Rich Burridge 2007-05-20 14:26:28 UTC
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.
Comment 4 Djihed Afifi 2007-05-20 16:03:18 UTC
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.
Comment 5 Djihed Afifi 2007-05-20 16:11:35 UTC
Thinking of it, do we reverse the numpad only or the whole interface?

I'm leaning towards reversing the whole interface.
Comment 6 Yair Hershkovitz 2007-05-20 19:39:44 UTC
I'm in for changing the whole interface, just like a real calculator looks like.
Comment 7 Behdad Esfahbod 2007-05-22 19:31:01 UTC
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.
Comment 8 Yair Hershkovitz 2007-07-01 14:19:44 UTC
Created attachment 90968 [details] [review]
set direction for calculator boxes toLTR
Comment 9 Yair Hershkovitz 2007-07-01 14:20:50 UTC
pretty simple. it still need to be verified that i've covered all relevant containers.
Comment 10 Rich Burridge 2007-07-01 15:11:10 UTC
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!
Comment 11 Yair Hershkovitz 2007-07-22 06:15:17 UTC
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.