{"thread":{"id":"2081","subject":"[PATCH] cogito: use locale date_fmt in obtaining default date format","startedAt":"2005-10-12T14:02:34Z","lastAt":"2005-10-12T15:26:44Z","messageCount":2,"participants":["Junichi Uekawa"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"10017","messageId":"878xwyomth.dancerj%dancer@netfort.gr.jp","threadId":"2081","inReplyTo":null,"subject":"[PATCH] cogito: use locale date_fmt in obtaining default date format","fromName":"Junichi Uekawa","fromEmail":"dancer@netfort.gr.jp","sentAt":"2005-10-12T14:02:34Z","receivedAt":"2005-10-12T14:02:34Z","isPatch":true,"sender":{"key":"dancer@netfort.gr.jp","avatar":null},"body":"Obtain the default date format information from the locale database \nif it's available. Currently, the default date is in a fixed format that \nis mostly US-centric; which results in a very weird-looking Japanese\ndate.\n\n\nSigned-off-by: Junichi Uekawa <dancer@debian.org>\n\n---\n\n\n cg-Xlib |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\n\n\n\ndiff --git a/cg-Xlib b/cg-Xlib\nindex 0ed275f..d6d0cc1 100755\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -210,7 +210,9 @@ showdate()\n \t# bash doesn't like leading zeros\n \t[ \"${tzhours:1:1}\" = 0 ] && tzhours=${2:0:1}${2:2:1}\n \tsecs=$(($secs + $tzhours * 3600 + $tzmins * 60))\n-\t[ \"$format\" ] || format=\"+%a, %d %b %Y %H:%M:%S $2\"\n+\t[ \"$format\" ] || \\\n+\t\tformat=\"+$(locale date_fmt)\" || \\\n+\t\tformat=\"+%a, %d %b %Y %H:%M:%S $2\"\n \tif [ \"$has_gnudate\" ]; then\n \t\tLANG=C $has_gnudate -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n \telse\n"},{"id":"10029","messageId":"8764s2hi2z.dancerj%dancer@netfort.gr.jp","threadId":"2081","inReplyTo":"878xwyomth.dancerj%dancer@netfort.gr.jp","subject":"Re: [PATCH] cogito: use locale date_fmt in obtaining default date format","fromName":"Junichi Uekawa","fromEmail":"dancer@netfort.gr.jp","sentAt":"2005-10-12T15:26:44Z","receivedAt":"2005-10-12T15:26:44Z","isPatch":true,"sender":{"key":"dancer@netfort.gr.jp","avatar":null},"body":"Hi,\n\n>  \tif [ \"$has_gnudate\" ]; then\n>  \t\tLANG=C $has_gnudate -ud \"1970-01-01 UTC + $secs sec\" \"$format\"\n>  \telse\n\nHmm... I just noticed that you're setting LANG=C here;\nwhich is not enough since LC_ALL will override the value.\n\nI'm not quite sure of the original intention;\nI've checked the users\n\n\ncg-log:\n\tFor local display; it should be okay to show the date in \n\tlocalized format.\n\ncg-mkpatch:\n\tIt might be intrusive to have a localized date in a patch;\n\tso having a localized output of showdate is mostly undesirable,\n\tbut it will depend on the project you work on.\n\t(The user can always unset locale)\n\n\nregards,\n\tjunichi\n"}]}