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 303381 - numerical widgets use European digits in locales with localized digits
numerical widgets use European digits in locales with localized digits
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkSpinButton
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 528351 (view as bug list)
Depends on: localedigits
Blocks: Persian
 
 
Reported: 2005-05-07 15:14 UTC by Farzaneh Sarafraz
Modified: 2018-05-02 14:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a screenshot demonstrating latin numbers in gtk treeview widgets (10.08 KB, image/png)
2005-05-07 15:15 UTC, Farzaneh Sarafraz
  Details
gtk patch (don't run it, it will eat your dog) (568 bytes, patch)
2005-08-22 11:43 UTC, Roozbeh Pournader
needs-work Details | Review
glib patch (this will eat the same dog again) (2.62 KB, patch)
2005-08-22 11:45 UTC, Roozbeh Pournader
needs-work Details | Review

Description Farzaneh Sarafraz 2005-05-07 15:14:24 UTC
Please describe the problem:
when we start a session in a language where numbers are written in a script
other than Latin, the gtk numerical widgets are still shown in latin.

Steps to reproduce:
1. launch something with numerical widgets, e. g. gedit in say, Persian locale:
LANG=fa_IR gedit
2. go to edit, preferences 


Actual results:
the numerical widgets are shown in latin script. (screenshot attached)

Expected results:
the numerical widgets should have been displayed in localized (here: Persian)
script characters.

Does this happen every time?
yes

Other information:
Comment 1 Farzaneh Sarafraz 2005-05-07 15:15:40 UTC
Created attachment 46131 [details]
a screenshot demonstrating latin numbers in gtk treeview widgets
Comment 2 Kristian Rietveld 2005-06-19 23:38:36 UTC
This is not a GtkTreeView specific bug, moving to main GTK+.
Comment 3 Kristian Rietveld 2005-06-19 23:38:45 UTC
This is not a GtkTreeView specific bug, moving to main GTK+.
Comment 4 Owen Taylor 2005-07-26 23:27:09 UTC
This would definitley need configure checks to see if the necessary 
format modifiers were supported.

Would it also need a preference? Do all users in those locales want 
localized digits in spinbuttons (and so forth)?
Comment 5 Behdad Esfahbod 2005-07-27 00:38:21 UTC
About a preference, I do not think so, but whether the widgets should have a
property to use ASCII or locale numerals, I'm not sure.  I cannot think of any
obvious place that ASCII is required in Persian.
Comment 6 Roozbeh Pournader 2005-07-27 14:28:55 UTC
They won't need a preference, no. Users would prefer to always see localized digits.

Currently, the only glibc locale to use alternative digits is the Persian for
Iran locale. Some Arab country users *may* want to be able to switch between
digit forms, *if* the maintainer of the Arabic locales decides to switch to
Arabic-Indic digit forms, but I see that as a lower-level setting, to appear
desktop-wide, possibly best to happen in the same glibc level, e.g. by having a
personal locale data file.

BTW, we don't have spinbuttons in hex, do we? If we do, those would need to
remain in ASCII (glibc doesn't support the "I" flag for "%x" anyway). Only
decimal numbers (both integer and float) need to use localized digits.
Comment 7 Behdad Esfahbod 2005-07-27 15:17:15 UTC
Attach a patch then. ;)

I think we can start by always using localized digits.  If we decide that we
need ASCII digits for any reason, we can always add the property later.
Comment 8 Roozbeh Pournader 2005-08-22 11:33:58 UTC
The glibc library is not yet capable of reading localized digits in floats,
which is what is needed for spinbuttons, but a patch has been submitted:

   http://sourceware.org/ml/libc-alpha/2005-06/msg00138.html

There are two options to fix this bug:

1) One is to wait for the incorporation of the patch in glibc and then
substitute the g_strtod() call with an equivalent scanf("%If", ...) in
"gtk/gtkspinbutton.c". This means more waiting, and the support only being
available on plaforms using glibc.

2) The other is to implement the code for reading localized digits in glib or
gtk to make it handle localized digits.  This means duplication of code, but
could also be implemented independent of the locale to some degree, like by
accepting all Unicode characters of the type decimal digit.

Owen, what do you think?

I am attaching a proof-of-concept patch. This will probably crash under any
other locale but fa_IR (and leaks memory under fa_IR). But it implements the
feature in spinbuttons.
Comment 9 Roozbeh Pournader 2005-08-22 11:43:52 UTC
Created attachment 51108 [details] [review]
gtk patch (don't run it, it will eat your dog)
Comment 10 Roozbeh Pournader 2005-08-22 11:45:26 UTC
Created attachment 51109 [details] [review]
glib patch (this will eat the same dog again)
Comment 11 Behdad Esfahbod 2005-08-29 06:58:11 UTC
Roozbeh,

I believe we want to go with option 1.  For one reason, I don't like option 2
(accepting all decimal digit sets), and the other reason is, for broader
support, we would simply wait for the glocale project instead of stuffing in
more bits into glib...

A complete patch is appreciated. :)
Comment 12 Behdad Esfahbod 2006-01-25 17:03:23 UTC
Can we start by a patch to use localized digits in output?
Comment 13 Roozbeh Pournader 2006-03-07 22:03:30 UTC
(In reply to comment #12)
> Can we start by a patch to use localized digits in output?

If we are just talking about spinbuttons, I don't think so. The current spinbutton code works by keeping a string in the widget, and uses g_strtod when it needs to get the value back. So we need to take care of the previously output digits in g_strtod or one can never read the widget.
Comment 14 Roozbeh Pournader 2006-03-08 04:14:16 UTC
Apparently one also needs to fix the number checking code in the gtk_spin_button_insert_text function to accept the localized digits and decimal separator.
Comment 15 Daniel Boles 2017-09-12 13:17:55 UTC
*** Bug 528351 has been marked as a duplicate of this bug. ***
Comment 16 GNOME Infrastructure Team 2018-05-02 14:09:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/247.