This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH v8 05/16] Implement the %OB specifier - alternative month names (bug 10871)
- From: Rafal Luzynski <digitalfreak at lingonborough dot com>
- To: libc-alpha at sourceware dot org, Zack Weinberg <zackw at panix dot com>
- Date: Wed, 5 Jul 2017 01:43:59 +0200 (CEST)
- Subject: Re: [RFC][PATCH v8 05/16] Implement the %OB specifier - alternative month names (bug 10871)
- Authentication-results: sourceware.org; auth=none
- References: <906183224.152188.1498644183114@poczta.nazwa.pl> <f5db4b4c-e987-930b-7602-6299f7d7bd1b@panix.com>
- Reply-to: Rafal Luzynski <digitalfreak at lingonborough dot com>
3.07.2017 23:30 Zack Weinberg <zackw@panix.com> wrote:
> [...]
> I don't think that this decision (whether %OB will return the standalone
> case and %B will return the contextual case, or vice versa) should be
> allowed to be locale-dependent. The decision of *which grammatical form
> is appropriate* for each context is obviously locale-dependent, but the
> rule of which formatter is for which context needs to be consistent
> across all locales, so that the _call to strftime_ itself doesn't need
> to be locale-dependent. (Not everyone is going to use %x and %X.)
>
> zw
I often see the format specifiers marked as translatable in
applications so the translators usually have more freedom of choice.
This is not limited to whether to use %B or %OB but things like:
day before or after the month? do we use spaces? should there be
dots or dashes or slashes between day/month/year? does our
language have month names at all (%B) or only numbers (%m)?
But this will not work if an application programmer decides to
generate the month names with nl_langinfo(): the decision whether
to use MON_1 or ALTMON_1 will not be locale-dependent. Therefore
it's more convenient to assume that alt_mon (in locale data definition
file) - nl_langinfo(ALTMON_x) - strftime("%OB") all return the
standalone case while the other form return the full-date case.
Regards,
Rafal