This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH v8 05/16] Implement the %OB specifier - alternative month names (bug 10871)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]