GNOME Bugzilla – Bug 317171
calendar should use localized digits
Last modified: 2006-01-26 20:40:20 UTC
Please describe the problem: when running a Persian session, year and day numbers in calendar are shown in Latin figures, while they should be displayed in Persian figures. Steps to reproduce: 1. run a Persian gnome-panel 2. click on the clock applet to view the calendar 3. here you are! Actual results: Expected results: numbers should be shown in farsi script Does this happen every time? yes Other information:
This is a pure GtkCalendar. Moving to GTK+.
Attached a trivial patch that make two integer conversions (week and day) translatable. This lets traslators replace it with %Id in po files and get localized numerals.
Created attachment 52917 [details] [review] localized digits in gtkcalendar
Created attachment 58105 [details] [review] Committed patch Hamed, you should not use _("%Id") anytime, anywhere. See the attached patch for how to use translation contexts. See docs for Q_ here: http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html
Created attachment 58109 [details] [review] Use "English" instead of "Latin" in translator comments. Using "digits used in English" is more clear and recommended.
That is not going to work well unless you increase the size of buffer.
and it looks like you need to have a word with the %d%d in gtk_calendar_size_request. That logic is questionable on several levels.
Thanks Morten. Fixing them. Any reason that the buffer in calendar_paint_day is 255 bytes?! I'm setting both buffer's to 9 bytes. that's the makimum length that two Unicode characters can take.
No particular reason that I can see, but I get 13: 2*6 + 1. Make it somewhat larger just in case some language needs something you have not thought of; special characters in front or in back.
Ok. FYI: Unicode characters are limited to 4 bytes in UTF-8.
Created attachment 58134 [details] [review] fixup patch Fixup patch. Can use a review. It fixes a bug in the extent calculation too. Thinking again, I'm not quite convinced that we need two separate translation strings for week digits and day digits. But it doesn't really hurt...
I think every Q_-translated string should have a translator comment. Go ahead and commit with that addition.
Thanks Morten and Matthias. Should be fixed now. 2006-01-25 Behdad Esfahbod <behdad@gnome.org> * gtk/gtkcalendar.c (gtk_calendar_size_request): Use translated format strings for L10n in size calculation too. * gtk/gtkcalendar.c (calendar_paint_week_numbers): Expand buffer to accomodate localized digits.