I'd like to notify you that today I've finished my works on date
formatting in glibc, that means upstream. These changes are already
arriving to Fedora Rawhide (they should be there tomorrow) and will
be part of Fedora 28. They will be included in glibc 2.27 (to be
released on February 1), or in pre-release upstream version
2.26.9000-1145 (in Fedora Rawhide: 2.26.9000-48).
What has been changed:
* strftime() family (including stftime_l(), wcstime(), wcstime_l(),
strptime() etc.): there are new format specifiers: %OB, %Ob, %Oh.
It has been specified that the currently existing format specifiers:
%B, %b, and %h generate the month names (%B--full month names, %b
and %h--abbreviated month names) in a grammatical form required when
the month is used as a part of a complete date (that means: together
with the day number) while the new format specifiers with %O (note:
this is O letter, the uppercase o, not the zero digit, 0) will generate
the month names in a grammatical form required when the month is named
by itself (without a day number, usually standalone). In most of the
languages there is no difference between those two forms. However,
there is a group of languages (about 20) where the correct form used in
the full date is a genitive case while standalone months must be
in a nominative case.
* strptime(): just accepts the new format specifiers: %OB, %Ob,
and %Oh; each of them recognizes any form of the month name.
* nl_langinfo() family (including nl_langinfo_l()): there are new
constants supported: ALTMON_1, ALTMON_2, … ALTMON_12, and also (kinda
undocumented): _NL_WALTMON_1, _NL_WALTMON_2, …, _NL_WALTMON_12;
_NL_ABALTMON_1, _NL_ABALTMON_2, …, _NL_ABALTMON_12; _NL_WABALTMON_1,
_NL_WABALTMON_2, …, _NL_WABALTMON_12. These new constants generate
the same month names as strftime() with %OB, %Ob, and %Oh format
specifiers (month names standalone, which means a nominative case
in some languages). The old constants MON_1, MON_2, …, MON_12,
ABMON_1, ABMON_2, …, ABMON_12 generate the same month names
as strftime() with %B, %b, and %h format specifiers--nothing new,
it has been the same since forever. But from now these constants
will generate the month names in a form used when the month name
is a part of a complete date. That means they are unsuitable to
generate the list of months standalone.
What needs to be changed:
* In Fedora: literally, nothing. The changes belong to upstreams
and I'm writing here in hope that some upstream developers are here
as well or you can forward the message to them. But of course
upstream software eventually lands in Fedora (as well as in other
distros). You may add "Requires: glibc >= 2.27" to the packages
which rely on this new feature, that means if their upstreams required
any changes in nl_langinfo() or strftime() calls.
* Translators: if you want this feature to be supported in your
language please notify me ASAP. There will be no change in the
languages for which the locale data in glibc are not changed.
So far only Polish language has been updated. Here is the list of
languages which probably need the update (the list may be incomplete):
Armenian, Asturian, Belarusian, Catalan, Croatian, Farsi, Greek,
Kashubian, Lithuanian, Ossetian, Russian, Scottish Gaelic,
Silesian, Sorbian (Upper and Lower), Ukrainian, Walloon.
These languages probably do not need the change but should put
their attention: Bosnian, Czech, Finnish, Serbian, Slovak.
* Applications using nl_langinfo() to display months: well, you
shouldn't use this function. This is a low-level function useful
to implement strftime(). But if you really want to you can but
you should stop using MON_* (and ABMON_*) and switch to ALTMON_*
(and _NL_ABALTMON_*) instead. You should detect whether it is
supported at compile time or at runtime. Well, it's tricky,
isn't it? Therefore it's better to use strftime().
* Applications using strftime() to format dates: if you display
a full date, including both the day number and the month name,
that is when the format specifier is "%d %b %Y" or "%B %e %Y"
or anything looking like that--no change is required. The only
case is when you display the month name standalone, whether it's
full ("%B") or abbreviated ("%b", "%h"), even when the year
number is included ("%B %Y"). This should be changed to "%OB"
* Other libraries than glibc which wrap or reimplement the same API
(like glib2 or gnulib): should enable this or apply the changes
to their implementation. By "enable" I mean "define the new
constants and do not raise an error when you see them or when
you see the %O[Bbh] format specifiers in strftime()".
* Other programming languages: the same as above, that means:
if your language just calls nl_langinfo() and strftime()
then make sure it calls it properly, defines the new constants
and does not raise errors, or if it implements the same feature
then the changes must be applied to your implementation.
* Testers: make sure the dates are displayed correctly, especially
in the calendars. You have to understand at least one of the
languages which I have mentioned above, though.
I guess this may lead to lots of questions and doubts. I have
answered many of them so far but I understand that my impact
is low so not many people heard the answers. Feel free to ask
here or better let's discuss this during DevConf.cz.
Name: Daniel da Silva
Location: Galicia, Spain
Language: Spanish, portuguese
Profession or student status: Degree in mechanical engineering student
About You: Sharing a passion between cars and computers, I like to experiment with all kind of open platforms that can help me take advantage of software and electronics (Raspberry Pi, Arduino). I dedicate some time to mantain a group of websites, too.
You and the Fedora Project: Fedora user since Verne (Fedora 16), interested in computers and electronics since I can remember. Fedora and other FOSS gave me the oportunity to take the advantage of not so modern hardware, since I like to use things until they have been well used, and to learn the versatility it can offer for all kind of platforms. Now I'll try to give it something back (not as a favor, but as gratitude) and starting by helping to make some translations where it can be needed, maybe other areas in the future. I'll try to understand all these platforms where Fedora development moves, hope I'm making the right moves.
GPG KEYID and fingerprint: 72A8BE53 / C0D1 5CC7 0ABD 314A 3B84 49EE A113 46A1 72A8 BE53