From patchwork Mon Apr 1 04:00:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TAMUKI Shoichi X-Patchwork-Id: 32113 Received: (qmail 104940 invoked by alias); 1 Apr 2019 04:01:23 -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 104638 invoked by uid 89); 1 Apr 2019 04:01:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=8620 X-HELO: mail.linet.jp Message-Id: <201904010400.AA04319@tamuki.linet.gr.jp> From: TAMUKI Shoichi Date: Mon, 01 Apr 2019 13:00:28 +0900 To: libc-alpha@sourceware.org Subject: [PATCH 4/4] ja_JP locale: Add entry for the new Japanese era [BZ #22964] In-Reply-To: <201904010352.AA04315@tamuki.linet.gr.jp> References: <201904010352.AA04315@tamuki.linet.gr.jp> MIME-Version: 1.0 The Japanese era name will be changed on May 1, 2019. The Japanese government made a preliminary announcement on April 1, 2019. The glibc ja_JP locale must be updated to include the new era name for strftime's alternative year format support. Checked on x86_64-linux-gnu. ChangeLog: [BZ #22964] * localedata/locales/ja_JP (LC_TIME): Add entry for the new Japanese era. * time/tst-strftime2.c (dates): Add 2019-04-30 and 2019-05-01. (mkreftable): Add rules for the new Japanese era and the new dates. Reviewed-by: Carlos O'Donell --- NEWS | 2 ++ localedata/locales/ja_JP | 6 ++++-- time/tst-strftime2.c | 13 ++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 684752ed53..4ad1ae65af 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,8 @@ Major new features: alternative calendar for the following locales: zh_TW, cmn_TW, hak_TW, nan_TW, lzh_TW. +* The entry for the new Japanese era has been added for ja_JP locale. + Deprecated and removed features, and other changes affecting compatibility: * The functions clock_gettime, clock_getres, clock_settime, diff --git a/localedata/locales/ja_JP b/localedata/locales/ja_JP index cb51e6d69d..c727997b6b 100644 --- a/localedata/locales/ja_JP +++ b/localedata/locales/ja_JP @@ -14952,7 +14952,7 @@ t_fmt_ampm "%p%I%M%S" % % The following dates and their names are recorded below in descending % date order (note that or follows each date). -% -> -> -> -> -> +% -> -> -> -> -> -> % % Each string is an era description segment with the format: % "direction:offset:start_date:end_date:era_name:era_format" @@ -14964,7 +14964,9 @@ t_fmt_ampm "%p%I%M%S" % - The last entry in era_name means BC. % - The second-to-last entry in era_name means AD. % -era "+:2:1990//01//01:+*::%EC%Ey";/ +era "+:2:2020//01//01:+*::%EC%Ey";/ + "+:1:2019//05//01:2019//12//31::%EC";/ + "+:2:1990//01//01:2019//04//30::%EC%Ey";/ "+:1:1989//01//08:1989//12//31::%EC";/ "+:2:1927//01//01:1989//01//07::%EC%Ey";/ "+:1:1926//12//25:1926//12//31::%EC";/ diff --git a/time/tst-strftime2.c b/time/tst-strftime2.c index 2c94bf592e..532e68f7d3 100644 --- a/time/tst-strftime2.c +++ b/time/tst-strftime2.c @@ -54,7 +54,9 @@ static const date_t dates[] = { 1, 4, 1997 }, { 1, 4, 1998 }, { 1, 4, 2010 }, - { 1, 4, 2011 } + { 1, 4, 2011 }, + { 30, 4, 2019 }, + { 1, 5, 2019 } }; static char ref[array_length (locales)][array_length (formats)] @@ -84,20 +86,20 @@ mkreftable (void) static const int yrj[] = { 43, 44, 45, 2, - 63, 64, 1, 2, 9, 10, 22, 23 + 63, 64, 1, 2, 9, 10, 22, 23, 31, 1 }; /* Buddhist calendar year to be checked. */ static const int yrb[] = { 2453, 2454, 2455, 2456, - 2531, 2532, 2532, 2533, 2540, 2541, 2553, 2554 + 2531, 2532, 2532, 2533, 2540, 2541, 2553, 2554, 2562, 2562 }; /* R.O.C. calendar year to be checked. Negative number is prior to Minguo counting up. */ static const int yrc[] = { -2, -1, 1, 2, - 77, 78, 78, 79, 86, 87, 99, 100 + 77, 78, 78, 79, 86, 87, 99, 100, 108, 108 }; for (i = 0; i < array_length (locales); i++) @@ -109,7 +111,8 @@ mkreftable (void) era = (is_before (k, 30, 7, 1912)) ? "\u660e\u6cbb" : (is_before (k, 25, 12, 1926)) ? "\u5927\u6b63" : (is_before (k, 8, 1, 1989)) ? "\u662d\u548c" - : "\u5e73\u6210"; + : (is_before (k, 1, 5, 2019)) ? "\u5e73\u6210" + : "\u4ee4\u548c"; yr = yrj[k], sfx = "\u5e74"; } else if (i == 1) /* lo_LA */