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

Re: [HEADS UP] Changes in date formatting (strftime, nl_langinfo)



24.01.2018 12:46 Viktar Siarheichyk <vics@fsfe.org> napisał(a):
>
> On Tue, Jan 23, 2018 at 04:31:42PM +0100, Rafal Luzynski wrote:
> > [...]
> > Thank you for responding. Indeed, Belarusian language is a special
> > case because with Russian they are the only languages which actually
> > need the %Ob feature. [1] The short answer to the question how you
> > can help is: just tell me that you want this feature in your language
> > and I will push the trigger, that's all. Belarusian patches are
> > waiting here, [2] you must search for the commit titled "Genitive
> > month names imported from CLDR (bug 10871)." and be_BY is there
> > along with other languages.
>
> Is there an easy way to convert strings like
> "<U0441><U0442><U0443><U0434><U0437><U0435><U043D><U044C>" to readable UTF?

At the moment, the easiest solution is to ask me. Here is the result:

diff --git a/localedata/locales/be_BY b/localedata/locales/be_BY
index 77f0e2a..ccc22b9 100644
--- a/localedata/locales/be_BY
+++ b/localedata/locales/be_BY
@@ -117,30 +117,54 @@ abday   "Няд";/
         "Чцв";/
         "Пят";/
         "Суб"
-mon     "Студзень";/
-        "Люты";/
-        "Сакавік";/
-        "Красавік";/
-        "Май";/
-        "Чэрвень";/
-        "Ліпень";/
-        "Жнівень";/
-        "Верасень";/
-        "Кастрычнік";/
-        "Лістапад";/
-        "Снежань"
-abmon   "Стд";/
-        "Лют";/
-        "Сак";/
-        "Крс";/
-        "Май";/
-        "Чэр";/
-        "Ліп";/
-        "Жнв";/
-        "Врс";/
-        "Кст";/
-        "Ліс";/
-        "Снж"
+alt_mon "студзень";/
+        "люты";/
+        "сакавік";/
+        "красавік";/
+        "май";/
+        "чэрвень";/
+        "ліпень";/
+        "жнівень";/
+        "верасень";/
+        "кастрычнік";/
+        "лістапад";/
+        "снежань"
+mon     "студзеня";/
+        "лютага";/
+        "сакавіка";/
+        "красавіка";/
+        "мая";/
+        "чэрвеня";/
+        "ліпеня";/
+        "жніўня";/
+        "верасня";/
+        "кастрычніка";/
+        "лістапада";/
+        "снежня"
+ab_alt_mon "сту";/
+        "лют";/
+        "сак";/
+        "кра";/
+        "май";/
+        "чэр";/
+        "ліп";/
+        "жні";/
+        "вер";/
+        "кас";/
+        "ліс";/
+        "сне"
+abmon   "сту";/
+        "лют";/
+        "сак";/
+        "кра";/
+        "мая";/
+        "чэр";/
+        "ліп";/
+        "жні";/
+        "вер";/
+        "кас";/
+        "ліс";/
+        "сне"
 d_t_fmt "%a %d %b %Y %T"
 d_fmt     "%d.%m.%Y"
 t_fmt     "%T"


Hm... only now I can see it is converting all month names
to lowercase but this is a direct import from CLDR. Do you
prefer standalone uppercase (as it is in glibc now) or lowercase
(as it is in CLDR)?  Hint: we usually treat CLDR as an authoritative
source.

For decoding, I'm using the script written by Mike Frysinger,
you can retrieve it from here:

https://sourceware.org/ml/libc-alpha/2016-04/msg00341.html

> > However, the Belarusian language is more tricky. Although be_BY
> > (Cyrillic) is in CLDR [3] so I can copy/paste/import/whatever,
> > be_BY@latin is not there but it is supported by glibc [4] and should
> > be updated. Could you please send me a list of Belarusian month names
> > in genitive case in Latin script so I can fix them? Something like
> > "studzenia", "lutaga" and so on, I am not sure if my transcription
> > is correct. This should also include the abbreviated month names
> > but I guess there will be no difference between abbreviated month
> > names in genitive case and in nominative case in be_BY@latin: "maj"
> > in genitive case is "maja" which will be abbreviated to "maj"; this
> > is different from the Cyrillic where the genitive case "мая" will
> > remain "мая" even in the abbreviated version.
>
> As for "Maj" there is a distinction. Belarusian latin script uses a different
> name for month may:
>
> $ LANG=be_BY@latin date -d 20180501 +%B
> Travień

Most probably this is because your glibc is older than 2.26 because
we have changed this last summer:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=8138dcc#patch2

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a259f5d#patch36

This is what CLDR says. Before applying this change I have consulted
with two Belarusian native speakers. They made a research and stated
that all Belarusian sources use "Maj"; the last occurrence of "Travień" 
comes from about 1995. If you think it's wrong then please file a ticket
in CLDR because, again, we treat it as an authoritative source.

> Thus the list of Belarusian month names in genitive case in Latin script is
> the following:
>
> studzienia
> lutaha
> sakavika
> krasavika
> traŭnia
> červienia
> lipienia
> žniŭnia
> vierasnia
> kastryčnika
> listapada
> śniežnia
>
> AFAIK there is no "official" abbreviated names for months in Belarusian, and
> CLDR [2] provides the initial 3 letters as abbreviated names so should we use
> for
> the Latin script.

Thank you, I will incorporate this change into be_BY@latin.

> [...]
> > Also please explain the uppercase/lowercase issue: in be_BY@latin
> > all month names start with the uppercase. I guess this looks nice
> > if the month name is standalone so I'd rather leave it as is;
> > OTOH I guess that the genitive month names (as used in dates)
> > should start with a lowercase letter.
>
> You are totally right.

Well, now I (we?) must rethink this. :-)

>
>
> > Actually, the sooner they are pushed the better; glibc is about
> > to be released on February 1.
> >
> > One more thing: since you have mentioned the translationproject.org,
> > please grep over all files (which I hope you have as a local
> > copy) and find all occurrences of %B or %b or %h without
> > the day number (%e or %d). Please verify that they are arguments
> > of strftime() or anything similar. They all should be replaced with
> > %OB, %Ob, and %Oh, respectively. I think that someone already did
> > this on libc-alpha list and found about 2 or 3 occurrences.
> > But that belongs to the general programming, not limited to
> > Belarusian language.
>
> You mean .po files? I was only translating libc po for Belarusion at the
> translationproject.org, I am not familiar with the libc sources.

Yes, I mean *.po files. I didn't mean glibc sources and didn't mean
*.po files for just glibc. AFAIK translationproject.org provides
translations for multiple programs. If you have a local copy of all
those *.po files (in Belarusian or in any language) then I will appreciate
if you notify me of any occurrences of "%B" or "%b" or "%h" without
the day number ("%d" or "%e") which either is a format specifier
for stftime() or it seems to be so.

Regards,

Rafal


Reply to: