From patchwork Fri Mar 29 02:53:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 1069022 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100983-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Mf5VXkZg"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44VmXj4M0bz9sNj for ; Fri, 29 Mar 2019 13:54:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=T0gh0SX7ZWE7F1ZE APjFm+JIwBfoBPPc20mhsry5cyEHxwJ98Agk66VePuN0y4b40pKd4EPiMxKQWEGs cqsGUmywIKtdM1A8uyOOv4/qc7aambQqHZyIWLh7znL0fsvPwwP+lkzDqveaDacP cqDoKfvAfJ0sUSPQq+H7pmTHVEI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=Yq4IJwIz38RNQe59kt/GP5 s6VsM=; b=Mf5VXkZgnsMLS5nJmxjqFqux31zetpqLugKm8jxS+FuVlTdiuePncw 9ZBgXHOaMZh28b7fsxh+gipfXi5dKW6Gwa88Fel76NA006QNJQwvuxYGFaMTR6w/ pcjhpnvXqqnJAKiujy0aoB2MbmQ9vN9jagf68hm0BRXUFjGaIbh00= Received: (qmail 87495 invoked by alias); 29 Mar 2019 02:54:05 -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 87402 invoked by uid 89); 29 Mar 2019 02:53:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, BODY_8BITS, GARBLED_BODY, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-qk1-f180.google.com Subject: [PATCH v2] Add verbose comments to 'era' in ja_JP locale. To: Rafal Luzynski , libc-alpha , DJ Delorie , TAMUKI Shoichi References: <557010721.507811.1553812550223@poczta.nazwa.pl> From: Carlos O'Donell Message-ID: <5f064c22-042a-a7d2-ecd8-a3aa9cb379cc@redhat.com> Date: Thu, 28 Mar 2019 22:53:45 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <557010721.507811.1553812550223@poczta.nazwa.pl> On 3/28/19 6:35 PM, Rafal Luzynski wrote: > 28.03.2019 19:09 Carlos O'Donell wrote: >> >> Rafal, >> >> While reviewing DJ's new test I went through all the dates, years, >> and names, and figured I'd put them into a verbose comment in ja_JP >> to make this easier to maintain in the future. >> >> What do you think of this for master? > > Sadly, I don't have enough knowledge about Japanese calendar to verify > if your comments are correct or not. Fortunately I can see Tamuki > Shoichi on the CC: list so I hope to read some feedback from him. If you find the new text useful then that's reason enough to include it :-) > Few remarks below, though: > >> 8< --- 8< ---- 8< >> --- >> localedata/locales/ja_JP | 23 +++++++++++++++++++++++ >> 1 file changed, 23 insertions(+) >> >> diff --git a/localedata/locales/ja_JP b/localedata/locales/ja_JP >> index 9bfbb2bb9b..74ef9e39f3 100644 >> --- a/localedata/locales/ja_JP >> +++ b/localedata/locales/ja_JP >> @@ -14946,6 +14946,29 @@ am_pm "";"" >> [...] >> +# Offset: Start date: End date: Era name: Using "gan": >> +# (Y) (YYYY-MM-DD) >> +# 2 1990-01-01 +* 平成 (Heisei) No > > What does the symbol "+*" mean? Am I the only one confused? Does > it maybe mean "infinity"? Can we use anything different, like "+inf"? Correct +* means for the rest of time. We could use anything we want. Please review glibc/locale/programs/ld-time.c (time_finish). The code is duplicated twice for start/stop date, and cleaning that up would be good. Then you could propose '+inf'/'-inf' as reasonable alternatives which are more readable. The entire format of the era entries is undocumented, and could do with documentation in the manual. As you see there is a lot to improve :-) I have added comments to answer questions here in ja_JP, which should for now serve as a "reference implementation" of an era name system update. >> +# 1 1989-01-08 1989-12-31 平成 (Heisei) Yes >> +# 2 1927-01-01 1989-01-07 昭和 (Shōwa) No >> +# 1 1926-12-25 1926-12-31 昭和 (Shōwa) Yes >> +# 2 1913-01-01 1926-12-24 大正 (Taishō) No >> +# 1 1912-07-30 1912-12-31 大正 (Taishō) Yes >> +# 6 1873-01-01 1912-07-29 明治 (Meiji) No >> +# 1 0001-01-01 1872-12-31 西暦 (C.E) No >> +# 1 -0000-12-31 -* 紀元前 (B.C.E.) No > > I was going to complain that the column with "Yes" and "No" is badly > unaligned. It appears bad in my email client but it became aligned > when I clicked "reply". Just please make sure all columns are aligned. > Unfortunately, this time "-*" (again, is this anything like "-inf"?) > looks shifted too much to the right and pushes the following columns. The Yes/No column is badly unaligned if you have non-fixed-width glpyhs for the era names which undoes the fixed-with table The columns use tabs, I've switched it to spaces to make it look better. I don't know if we can get any better alignment than what we have. > Hm... if it means "-inf" then shouldn't the columns be swapped, I mean > "Start date: -inf, End date: -0001-12-31"? No, because BCE counts *up* going backwards, so the difference it yields is still a positive number of years. e.g. 1 BCE 2 BCE 3 BCE ... (to the start of time) > > (Yes, I read your another email as well.) > >> +# >> +# Note: >> +# - The last entry 紀元前 means pre-era/B.C./B.C.E. >> +# - The second-to-last entry 西暦 means C.E. > > Aren't the terms "B.C.", "B.C.E.", and "C.E." reserved for the > Christian calendar? I'm sorry about my ignorance. The Christian calendar is the adopted civil calendar in many parts of the world. The filler era names have been there since 1999, but I don't see that there was any consensus about the exact text to use. It fills in the era name for entries not provided with something sensible: before common era / common era. commit 949e1b13eed30d12e34c2618484962a8a9234cc7 adds them. > I think I need further explanations before I tell any opinion about > this patch. Of course, I'll appreciate if other people give more > valuable feedback. > > Regards, > > Rafal > OK, here is a v2 - Use space for table and compress size a bit. - Describes '+*', '-*' and '-0001' year date. 8< --- 8< --- 8< Reviewed-by: Rafal Luzynski --- localedata/locales/ja_JP | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/localedata/locales/ja_JP b/localedata/locales/ja_JP index 9bfbb2bb9b..b0f617a660 100644 --- a/localedata/locales/ja_JP +++ b/localedata/locales/ja_JP @@ -14946,6 +14946,32 @@ am_pm "";"" t_fmt_ampm "%p%I%M%S" +# The era names are laid out in groups of 2 to account for the desire +# to avoid using '1' for the first era year. Instead of 1 we use '元' +# or "gan" as the first era year. +# +# The following dates and their names are recorded below in descending +# date order (note that '年' or "year" follows each date). +# +# Offset: Start date: End date: Era name: Using "gan": +# (Y) (YYYY-MM-DD) +# 2 1990-01-01 +* 平成 (Heisei) No +# 1 1989-01-08 1989-12-31 平成 (Heisei) Yes +# 2 1927-01-01 1989-01-07 昭和 (Shōwa) No +# 1 1926-12-25 1926-12-31 昭和 (Shōwa) Yes +# 2 1913-01-01 1926-12-24 大正 (Taishō) No +# 1 1912-07-30 1912-12-31 大正 (Taishō) Yes +# 6 1873-01-01 1912-07-29 明治 (Meiji) No +# 1 0001-01-01 1872-12-31 西暦 (C.E) No +# 1 -0001-12-31 -* 紀元前 (B.C.E.) No +# +# Note: +# - The '+*' entry means "forever going forward" +# - The '-*' entry means "forever going backwards" count up. +# - Negative start date is 1 B.C.E (not -1 C.E.) counting up. +# - The last entry 紀元前 means pre-era/B.C./B.C.E. +# - The second-to-last entry 西暦 means C.E. +# era "+:2:1990//01//01:+*::%EC%Ey";/ "+:1:1989//01//08:1989//12//31::%EC";/ "+:2:1927//01//01:1989//01//07::%EC%Ey";/