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 v4 06/11] Provide backward compatibility for strftime family (bug 10871).


On 11/08/2016 12:39 PM, Rafal Luzynski wrote:

CLDR refers to "stand-alone" and "format", it seemed to ambiguous to me.
More info:
http://cldr.unicode.org/translation/date-time#TOC-Stand-Alone-vs.-Format-Styles

I think this distinction is not too bad. It's certainly an improvement over the declension-based approach. The additional explanation regarding elision is also helpful.

then all applications
which currently use %B are broken

Are they broken already? When you type this command:

$ date +"%d %B %Y"

is it broken in German locale?

Yes, it should be

$ date +"%-d. %B %Y

This wasn't your point, but it's still relevant because it means that such date format strings need translation. But that's probably true for the strings used by tools like cal (where "%B %Y" may not work unconditionally today).

Note that a genitive form will be used only if it is provided in
locale data. So if German language has a genitive form but does not
require (or even prohibits) using it when formatting a full date then
all you have to do is not to provide any changes to the locale, just
leave it as is. My patch provides a way to provide two different
forms for month names but this second form is optional. There will
be no change visible if there are no changes in the locale data.
That's the reason why I have also provided sample locale data for
some languages; these changes are not intended to be committed
(although may be committed if translators apparently find them
correct).

Right, German wouldn't need any changes because there is only one set of month names relevant here.

In your example, a phrase “on the last Sunday of November” looks
like an attempt to employ strftime() to generate natural language
sentences rather than to format a date. It's been discussed in
bugzilla and stated that strftime() will never be suitable for this.

Yes, I fully expect that this would not work. The use of the genitive in full date specifications has almost completely died out in German, and the genitive is no longer very pronounced, either (the trailing “s” is sometimes elided).

I still find it odd that we want to turn %B into the mangled name for full dates, and not %OB (and switch all the formats in places that want to use the new capability). The latter seems to be better from a backwards-compatibility perspective.

In fact, a *lot* of languages today use "%d de %B" as the date format string (although not in our locales, we usually sidestep this by using abbreviations only for %c). In some of these languages, the “e” in “de” is subject to elision, so we really want

  14 d'abril

and not

  14 de abril

The only wait to get this is to put the “de” and “d'” into the mangled month name (as has been suggested in the CLDR reference). But this means that "%d de %B" (which seems to be the most commonly used form for these languages today) is expanded into “14 de d'abril”, which is not what we want. I am worried that this puts pressure on us *not* to introduce mangled month names at all for these languages.

These issues go away if we keep the existing month names unchanged and add the new mangled names under new identifiers.

Florian


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