GNOME Bugzilla – Bug 311409
%O flag in po files doesn't work properly
Last modified: 2021-06-09 20:33:50 UTC
Distribution/Version: fedora core 4 bad result often when there is %O flag in the msgstr in po files. expected result: localized year and day numbers should be displayed in localized digits actual result: year and day numbers are dislayed in European digits and the numbers of day and year are not localized. sample abstracts from the .po file causing this problem, followed by an abstract that works fine: #: ../src/planner-default-week-dialog.c:299 #: ../src/planner-default-week-dialog.c:303 msgid "%H:%M" msgstr "%OH:%OM" #. i18n: project start, the date format is described in #. * libmrproject/docs/DateFormat. #: ../src/planner-gantt-background.c:579 msgid "%Y %b %d" msgstr "%Od %B %Oy" #: ../src/planner-gantt-header.c:671 msgid "%e %b %Y" msgstr "%Od %B %Oy" this one works fine: #. i18n: time stamp format for notes in task dialog, see strftime(3) for #. * a detailed description. #: ../src/planner-resource-dialog.c:1404 ../src/planner-task-dialog.c:1807 msgid "%a %d %b %Y, %H:%M\n" msgstr "%A %Od %B %Oy، ساعت %OH:%OM\n"
How are you testing it? What are your locale settings, etc?
Reopening and confirming the bug. The 'O' flag doesn't work under any locale.
I checked the function mrp_time_format() in Planner and found that it implements the time and date formats independently of the C library. I believe it should be fixed somehow to support localized digits. There are a few ways to do that: 1. One way is to make the function time_format_helper() use localized digits according to the current locale. This way translators won't need to translate the messages the old way. They would use "%Y" for the year and see it in localized digits. 2. Another way is to make the above function use glibc's standard %O flag to localize the digits. This is not prefered because it offers a very limited functionality, and it's only possible for some of the numerical things. 3. The final way is to define a new Planner-specific flag and implement it to support localized digits. I prefer the first method, but I'd like to know which way is prefered by the maintainers.
-- 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/World/planner/-/issues/89.