GNOME Bugzilla – Bug 568571
Asian am/pm format on cups print backend's time parsing
Last modified: 2009-02-12 12:14:46 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:
Do you have a proposal for suitable formats to add to the list ?
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 "
Created attachment 127453 [details] [review] proposed patch Hi, this is a patch adding the formats mentioned above. Marek
Thanks, please commit, but without the change to the tooltip. No need to upset translators...
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