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 568571 - Asian am/pm format on cups print backend's time parsing
Asian am/pm format on cups print backend's time parsing
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.15.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-21 16:40 UTC by Changwoo Ryu
Modified: 2009-02-12 12:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
proposed patch (2.04 KB, patch)
2009-01-29 13:14 UTC, Marek Kašík
committed Details | Review

Description Changwoo Ryu 2009-01-21 16:40:49 UTC
Please describe the problem:
The current time parsing code assumes am/pm format is at the end of string after hour/minute/second. In modules/printbackends/cups/gtkprintbackendcups.c:

gchar *
localtime_to_utctime (const char *local_time)
{
  const char *formats_0[] = {" %I : %M : %S %p ", " %H : %M : %S ", " %I : %M %p ", " %H : %M ", " %I %p "};

...

But it won't parse Asian time format. In Asian languages, there is am/pm format (%p in strftime) but usually this is written _before_ hour/minute/second. These prefixed 午前/오전/上午 is "am".

duncan:~$ LANG=ja_JP.utf8 date +%r
午前01時36分09秒
duncan:~$ LANG=ko_KR.utf8 date +%r
오전 01시 36분 12초
duncan:~$ LANG=zh_CN.utf8 date +%r
上午 01时36分25秒


Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Matthias Clasen 2009-01-22 07:29:06 UTC
Do you have a proposal for suitable formats to add to the list ?
Comment 2 Roozbeh Pournader 2009-01-23 23:43:16 UTC
From my experience with East Asian locales, the only big difference is that the AM/PM indicators appear before the numbers, and that there is sometimes no space between them. Spaces seem to 

Following the existing list, these three should be added:
" %p %I : %M : %S "
" %p %I : %M "
" %p %I "
Comment 3 Marek Kašík 2009-01-29 13:14:43 UTC
Created attachment 127453 [details] [review]
proposed patch

Hi,
this is a patch adding the formats mentioned above.

  Marek
Comment 4 Matthias Clasen 2009-01-31 05:08:52 UTC
Thanks, please commit, but without the change to the tooltip. 
No need to upset translators...
Comment 5 Marek Kašík 2009-02-12 12:14:46 UTC
Committed:

2009-02-12  Marek Kasik

        Bug 568571 – Asian am/pm format on cups print backend's time parsing

        * modules/printbackends/cups/gtkprintbackendcups.c: Add Asian am/pm
        format into formats recognized by CUPS backend

  Thank you for your report

    Marek