[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changes in nl_langinfo() and strftime() API in glibc

From: Rafal Luzynski
Subject: Re: Changes in nl_langinfo() and strftime() API in glibc
Date: Thu, 25 Jan 2018 02:13:46 +0100 (CET)

24.01.2018 14:47 Bruno Haible <address@hidden> wrote:
> Hi Rafal,
> [...]
> > The issue is when the day number and the month name appear
> > together.
> > ...
> > So, when there is no day number (and nothing similar, like
> > "the second week of" or "the first Sunday of") the month
> > name counts as standalone, a nominative case.
> Good. Here you have formulated the precise statement that I sought for.
> Can you please update the doc accordingly? Change
> "when the month is used as part of a complete date"
> to
> "when the month appears together with a day-of-month".

OK, I have posted this suggestion to libc-alpha:


> (AFAICS strftime does not support week-of-month statements, only
> week-of-year.)

That's true, I was thinking about possible constructions supported
by a native language.  You are right, this particular construction
is not supported by strftime().

> [...]
> > Short answer to all your questions: whatever date format you use
> > you should make it translatable, like:
> >
> > strftime (s, max, _("%A, %B %d, %y), ...
> >
> > so you leave the correct format for the translators.
> Ah, but translators will not look in the glibc manual. They read only
> the gettext manual. So do we need some text in the gettext manual as
> well?

I'm not sure which gettext manual you are thinking about but
this gettext manual is actually a part of glibc:


> In other words, is the %B / %OB distinction something that the
> programmer can do, and the translator is not bothered about it?

I strongly believe that the format strings should be left for
the translators and the programmer's choice of a format string
should be correct for English but this is seldom correct for other
languages. This is not because of the genitive/nominative month
names but for the reasons like:

- English often uses the month-day order, most of other languages
  use the day-month order;
- many languages require a dot after the day number;
- English requires a comma after the day number if it is followed
  by a year number;
- some languages (e.g., East Asian) do not have month names and
  use the month numbers instead;
- and many more...

> Or
> is this distinction different according to language, so the translators
> must deal with it?

The reasons above are sufficient to tell that the translators must
have dealt with it since forever. If you are asking whether the rules
where to use %OB and where %B are universal (so the translators will
not have to decide) or not (different in different languages) I must
say that I strongly doubt about how these rules work in Czech,
Serbian, and Slovak language. But let's take a look at these
numbers (they may be inaccurate, take them as an approximation):

- there are about 200 languages supported by glibc;
- about 20 of them (10%) need the nominative/genitive distinction,
  in the rest of the languages there is no difference between %OB and %B;
- about 3 of those 20 (1.5% of the total number) the rules of %OB/%B
  may be different.

That means that if you (as a programmer) use %OB/%B correctly then
it will work correctly either immediately or with minor changes (reorder,
add/remove punctuation) in about 98.5% of languages.  Another good
news is that if you use them incorrectly then 90% of languages
will not see any difference. :-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]