[v2] Add verbose comments to 'era' in ja_JP locale.
diff mbox series

Message ID 5f064c22-042a-a7d2-ecd8-a3aa9cb379cc@redhat.com
State New
Headers show
Series
  • [v2] Add verbose comments to 'era' in ja_JP locale.
Related show

Commit Message

Carlos O'Donell March 29, 2019, 2:53 a.m. UTC
On 3/28/19 6:35 PM, Rafal Luzynski wrote:
> 28.03.2019 19:09 Carlos O'Donell <codonell@redhat.com> 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	"<U5348><U524D>";"<U5348><U5F8C>"
>> [...]
>> +# 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<

---
  localedata/locales/ja_JP | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)

Comments

Rafal Luzynski March 29, 2019, 9:38 p.m. UTC | #1
29.03.2019 03:53 Carlos O'Donell <codonell@redhat.com> wrote:
> [...]
> If you find the new text useful then that's reason enough to include it
> :-)

OK, it is useful because it explains the things I wouldn't know otherwise.

> > [...]
> > 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 :-)

OK, the symbols "+*" and "-*" are used in the source code (locale data
language, if it can be called so).  I meant that we could use something
more human-readable for the comment.

> [...]
> 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.

The new patch looks better, thank you.

> > [...]
> > 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.

OK, sorry, I misunderstood.  I thought that the term "B.C." was used
for "before Meiji era" which would be quite confusing.  Now I can see
it has the same meaning as we have in Europe and in many other parts
of the world.  Sorry, I feel tired these days, please take all my
comments with a grain of salt.

> [...]
> OK, here is a v2
> - Use space for table and compress size a bit.
> - Describes '+*', '-*' and '-0001' year date.

Your patch became corrupted in the email: some lines have got an
additional space in the beginning.  However, I managed to rework and
apply it locally and I believe that you have the original version of
it so this is a minor issue.

> [...]
> ---
>   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	"<U5348><U524D>";"<U5348><U5F8C>"
>   
>   t_fmt_ampm "%p%I<U6642>%M<U5206>%S<U79D2>"
>   
> +# 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 '元'
> +# <U5143> or "gan" as the first era year.
> +#
> +# The following dates and their names are recorded below in descending
> +# date order (note that '年' <U5E74> or "year" follows each date).
> +#
> +# Offset: Start date:   End date:   Era name:        Using "gan":
> +# (Y)     (YYYY-MM-DD)
> +# 2       1990-01-01    +*          平成 (Heisei)    No

For the record: this line will have to be changed very soon.

> +# 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

Suggestion: remove one space before "-0001" so that the dates are
aligned perfectly.  Like this:

# 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.

For the consistency: did you mean "counting up" instead of "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.
> +#

Please put the literal Japanese strings in quotes:

# - The last entry "紀元前" means pre-era/B.C./B.C.E.
# - The second-to-last entry "西暦" means C.E.

Double quotes or single quotes, as you prefer.

OK with this one change, the previous changes are just suggestions,
which means feel free to ignore if you think that your version is OK.

Reviewed-by: Rafal Luzynski <digitalfreak@lingonborough.com>

Regards,

Rafal

Patch
diff mbox series

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	"<U5348><U524D>";"<U5348><U5F8C>"
  
  t_fmt_ampm "%p%I<U6642>%M<U5206>%S<U79D2>"
  
+# 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 '元'
+# <U5143> or "gan" as the first era year.
+#
+# The following dates and their names are recorded below in descending
+# date order (note that '年' <U5E74> 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:+*:<U5E73><U6210>:%EC%Ey<U5E74>";/
  	"+:1:1989//01//08:1989//12//31:<U5E73><U6210>:%EC<U5143><U5E74>";/
  	"+:2:1927//01//01:1989//01//07:<U662D><U548C>:%EC%Ey<U5E74>";/