From patchwork Fri Nov 2 11:11:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafal Luzynski X-Patchwork-Id: 30005 Received: (qmail 28684 invoked by alias); 2 Nov 2018 11:12:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28582 invoked by uid 89); 2 Nov 2018 11:12:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, XPRIO autolearn=ham version=3.3.2 spammy=consulting, clock, hour, Ethiopia X-HELO: shared-ano163.rev.nazwa.pl X-Spam-Score: 0.621 Date: Fri, 2 Nov 2018 12:11:09 +0100 (CET) From: Rafal Luzynski To: libc-alpha@sourceware.org Message-ID: <726702465.188131.1541157069943@poczta.nazwa.pl> Subject: [RFC][PATCH] Multiple locales: Use the correct date and time formats (bug 10496, 23724). MIME-Version: 1.0 Hi, I need an advice. Recently I've been working on a change which initially seemed to be a simple one-liner but eventually turned out to be updating 80 locales. The change fixes the 12-hour time formats, adding the AM/PM indicator and changing the hour format. The locales mostly include those using Arabic language, from India, and from the region of Eritrea, Ethiopia and Somalia. My question is: should I treat the CLDR database literally and change the time formats like "%I:%M:%S" to "%l:%M:%S" whenever CLDR provides the time format "h:mm:ss"? I spotted this difference while importing the time formats from CLDR in order to find those which should use the AM/PM indicator. The difference is that "%I" is a zero-padded hour number while "%l" is a space-padded hour number; in CLDR format "h" is an hour number using as many digits as necessary (no additional padding mentioned). My doubt is because the original complaint here was about missing the AM/PM indicator, nobody complained about the clock using the zero-padded hour number. I am afraid that the change is minor and irrelevant and most people's answer even from the involved countries is "I don't know/I don't care". So if the glibc community does not provide any sustained objection I will prepare and eventually commit this change. As a sample here please find attached a patch for Albanian language. I'd like to fix this locale as a separate patch because this also fixes the date formats and it cannot be separated from the time formats. If accepted I will commit this patch and move to other locales. I am consulting this change with the people from Albania and India but I don't know anyone speaking Arabic or living in Eritrea, Ethiopia or Somalia. Regards, Rafal From 3ad4684e4546d89d85c9434090b3950db95e34de Mon Sep 17 00:00:00 2001 From: Rafal Luzynski Date: Tue, 9 Oct 2018 01:15:33 +0200 Subject: [PATCH] sq_AL: Use the correct date and time formats (bug 10496, 23724). Albanian locale uses the 12-hour clock but some time formats did not use any AM/PM indicator making the time ambiguous. This commit adds "%p" wherever it was missing. It also sets the correct date format because the old "%Y-%b-%d" produced rather weird results like "2018-Sht-28". All time formats come from CLDR but as few changes have been introduced by this commit as possible. Some articles from MSDN and other available online sources have been also taken into account. [BZ #10496] [BZ #23724] * localedata/locales/sq_AL (t_fmt): Set to "%l:%M:%S.%p %Z". (t_fmt_ampm): Likewise. (d_t_fmt): Set to "%a %-d %b %Y %l:%M:%S.%p". (date_fmt): Add, set to "%a %-d %b %Y %l:%M:%S.%p %Z". (d_fmt): Set to "%-d.%-m.%y". --- localedata/locales/sq_AL | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/localedata/locales/sq_AL b/localedata/locales/sq_AL index 9cec37a..a90251f 100644 --- a/localedata/locales/sq_AL +++ b/localedata/locales/sq_AL @@ -303,16 +303,19 @@ mon "janar";/ am_pm "PD";"MD" % % Appropriate date and time representation -d_t_fmt "%Y-%b-%d %I.%M.%S.%p %Z" +d_t_fmt "%a %-d %b %Y %l:%M:%S.%p" +% +% Appropriate date representation for date(1) +date_fmt "%a %-d %b %Y %l:%M:%S.%p %Z" % % Appropriate date representation -d_fmt "%Y-%b-%d" +d_fmt "%-d.%-m.%y" % % Appropriate time representation -t_fmt "%I.%M.%S. %Z" +t_fmt "%l:%M:%S.%p %Z" % % Appropriate 12 h time representation (%r) -t_fmt_ampm "%I.%M.%S.%p %Z" +t_fmt_ampm "%l:%M:%S.%p %Z" week 7;19971130;1 first_weekday 2 END LC_TIME -- 2.7.5