[PATCH v2] localedata: Add Minguo calendar support to zh_TW

Rafal Luzynski digitalfreak@lingonborough.com
Sat Mar 2 17:48:00 GMT 2019


2.03.2019 18:04 Felix Yan <felixonmars@archlinux.org> wrote:
> On 2019/3/2 下午11:49, Rafal Luzynski wrote:
> > $ LC_TIME=zh_TW.UTF-8 ./testrun.sh /usr/bin/date +%Ey -d 1913-01-01
> > 02
> > $ LC_TIME=zh_TW.UTF-8 ./testrun.sh /usr/bin/date +%EY -d 1913-01-01
> > 民國02年
> 
> There seems to be a small difference here:
> 
> $ LC_TIME=zh_TW.UTF-8 /usr/bin/date +%Ey -d 1913-01-01
> 2
> $ LC_TIME=zh_TW.UTF-8 /usr/bin/date +%EY -d 1913-01-01
> 民國2年
> 
> The text is correct without the zero padding before number. Am I missing
> something that caused this difference?

Yes, it's a new feature added to glibc 2.29 shortly before the release. [1]
If you want "2" without the zero padding you must use "%-Ey" or "%-EY".

> > Please confirm this is what you wanted to achieve.  Being unable to
> > read Chinese script I can only verify the numbers and I can only
> > trust you that this is correct otherwise.
> 
> Apart from the above difference, the other parts are correct. I have
> double confirmed this on #l10n-tw too.

Thank you.

> > Now please look inside the localedata/locales directory. [1] There
> > are 5 other locales from Taiwan: cmn_TW, hak_TW, lzh_TW, nan_TW,
> > and nan_TW@latin.  If Minguo calendar is popular in Taiwan then do
> > you think that those other locales need the same update as well?
> > Can you please update them, and maybe squash all changes into a single
> > patch?
> 
> For nan_TW@latin maybe I need to find a Minnan user. I didn't find one
> yet though. Would it be possible to leave that one out for now?

Sure.  You can contribute another patch referring to the same bug report
if you contribute it soon.  You will need to file a new bug report after
2.30 is released (August 2019).

> >> Some background information: The government website (www.gov.tw) uses
> >> it
> >> without the prefix, popular public services like Taiwan HSR also uses
> >> this calendar system.
> > 
> > I don't understand what is the prefix ("without the prefix") here.
> > Is this a typo or maybe just a concept I am not familiar with?
> 
> I meant the short version (%Ey), sorry for the confusion.
> 
> I'll send a revised patch soon.

Thank you.  I saw your email but I have not tested/reviewed yet.

Regards,

Rafal


[1] https://sourceware.org/bugzilla/show_bug.cgi?id=23758



More information about the Libc-alpha mailing list