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 342446 - evolution should use localized digits in calendar
evolution should use localized digits in calendar
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Calendar
2.2.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
Depends on:
Blocks: Persian 574210
 
 
Reported: 2006-05-20 20:29 UTC by Behnam Esfahbod
Modified: 2013-09-10 13:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
patch for version 2.2.3 (2.79 KB, patch)
2006-05-20 20:34 UTC, Behnam Esfahbod
committed Details | Review
Use %Id only if the libc version is >= 2.2.3. (2.95 KB, patch)
2009-03-08 16:02 UTC, Chenthill P
committed Details | Review

Description Behnam Esfahbod 2006-05-20 20:29:49 UTC
The evolution calendar widget uses English digits. It should use Persian digits
when the session is in Persian.
Comment 1 Behnam Esfahbod 2006-05-20 20:34:09 UTC
Created attachment 65917 [details] [review]
patch for version 2.2.3
Comment 2 Chenthill P 2006-06-07 08:28:07 UTC
Adding srini to CC list.
Comment 3 André Klapper 2006-08-29 14:40:59 UTC
srini: ping
Comment 4 André Klapper 2007-04-01 21:51:11 UTC
srini: PING.
Comment 5 Srinivasa Ragavan 2007-04-02 03:59:02 UTC
Behnam, I haven't reviewed the patch yet, but does that work for 2.10.0 also?
Comment 6 André Klapper 2007-05-15 15:18:06 UTC
behnam: ping
Comment 7 Behnam Esfahbod 2007-06-29 23:58:14 UTC
Well, what should I do right now?  I'm ready to test it with a clean jhbuild build.  What module should I use for test? GNOME 2.20?
Comment 8 Chenthill P 2007-12-03 09:30:27 UTC
You can use GNOME-2.22 for svn HEAD atm.
Comment 9 Chenthill P 2009-01-21 06:42:08 UTC
The patch looks good. Tested with english and persian (fa_IR) locales and it works fine. It can be committed to both stable and trunk.
Comment 10 Behnam Esfahbod 2009-01-21 06:55:49 UTC
Thanks chenthill for the review.

Just, now that I look again at the patch I think we can clean up the code by removing "if (week_num >= 10)" and "if (day_num >= 10)", and call pango_layout_get_pixel_size on the buffer directly, instead of caching the character width.  IMHO pango must have an internal cache for this job.  Behdad?
Comment 11 Behdad Esfahbod 2009-01-23 21:17:28 UTC
Not sure what the question is.  Just do it however is simpler.  Think about caching and optimizing only if you can measure that it's too slow for the job.
Comment 12 Suman Manjunath 2009-01-30 09:31:54 UTC
Patch committed to stable (gnome-2-24) branch as r37190
http://svn.gnome.org/viewvc/evolution?view=revision&revision=37190

Patch committed to SVN trunk as r37186
http://svn.gnome.org/viewvc/evolution?view=revision&revision=37186
Comment 13 Matthias Drochner 2009-02-26 20:25:07 UTC
This change hurts portability because the "%Id" format is Linux-only.
Comment 14 André Klapper 2009-02-26 20:43:33 UTC
so as the patch is in... why is this still open?

OK, maybe because of the last comment.
Matthias, which platform do you refer to? Any potential solution/workaround?
Comment 15 Matthias Drochner 2009-02-28 13:37:23 UTC
> which platform do you refer to?
I'm running NetBSD, but I haven't seen any mention of that format in *BSD,
Solaris nor OSF/1 manpages.

> Any potential solution/workaround?
Sorry, I don't have an idea. It seems there is no portable way to get the
preferred decimal number font out of localeconv(3) or nl_langinfo(3).
This would suggest a user selectable option which is a bigger change.
I'd be fine with some "#ifdef __GLIBC__" for now.
Comment 16 Chenthill P 2009-03-02 05:36:47 UTC
I think its better to add the #ifdef _GLIBC__2.2.3 to check if the glibc version is abover 2.2.3. This %I flag has been added from 2.2.3.

Behnam, please provide a patch incorporating the above mentioned changes.
Comment 17 Behnam Esfahbod 2009-03-02 17:09:12 UTC
Thanks Matthias and chenthill.

(In reply to comment #16)
> Behnam, please provide a patch incorporating the above mentioned changes.

Unfortunately I won't be able to work on this in the next few weeks.  As it's a blocker right now, would someone fix it please?

Thanks again.
Comment 18 Chenthill P 2009-03-03 09:35:31 UTC
Ok np I will do it.
Comment 19 Matthew Barnes 2009-03-04 12:11:47 UTC
Proposed patch for the portability regression in bug #574045.
Comment 20 Wang Xin 2009-03-05 03:06:58 UTC
I provided the patch for bug #574045. The patch uses _("%Id") to replace "%Id". This is because on Solaris, we have a script to handle such GNU extensions in .po files. This script can turn %Id in *.po into %d. I am not sure how BSD or other platform handle this situation.
Comment 21 Chenthill P 2009-03-05 11:56:22 UTC
I am thinking of using gnu_get_libc_version to identify whether the version of glibc is >= 2.2.3 to use %Id.

If gnu_get_libc_version (added from libc 2.1) is not defined or if the version is less that 2.2.3 use the %d format. Would that be the right fix?

Wang, I will commit your patch along with the one which am making now.
Comment 22 Wang Xin 2009-03-06 02:41:33 UTC
Thanks, Chenthill.
Comment 23 Chenthill P 2009-03-08 16:02:52 UTC
Created attachment 130284 [details] [review]
Use %Id only if the libc version is >= 2.2.3.

Mathias, please confirm if this fixes the bug for you. I have committed the fix as its a hard code freeze tomorrow.
Comment 24 André Klapper 2009-03-08 19:37:33 UTC
this broke the string freeze.
please act.
Comment 25 Srinivasa Ragavan 2009-03-09 04:05:38 UTC
_('%Id')  -  what should be translated here? Am I missing something?
Comment 26 Wang Xin 2009-03-09 04:32:57 UTC
In my original patch, I add _() to "%Id" because we use a script to manipulate .po files to translate "%Id" to "%d". In the new patch, "%d" is used on platform which does not support "%Id". So _() is not necessary, I think.
Comment 27 Chenthill P 2009-03-09 04:41:06 UTC
Oh ok. I was just having solaris build in mind and completely missed the string freeze. Sorry. Will remove the string marked for translation immediately.
Comment 28 Chenthill P 2009-03-09 04:50:03 UTC
Removed the string marked for translation, http://svn.gnome.org/viewvc/evolution?view=revision&revision=37390 .
Comment 29 Matthias Drochner 2009-03-09 09:33:34 UTC
> Mathias, please confirm if this fixes the bug for you.

Sorry, I'm on travel, but from code inspection this looks OK.
(I'd have used some static vars in the glibc case so that
the string manipulation is done only once.)