This is the mail archive of the libc-locales@sourceware.org mailing list for the GNU libc locales 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]

[Bug localedata/10871] ru_RU: 'mon' array should contain both nominative and genitive cases


https://sourceware.org/bugzilla/show_bug.cgi?id=10871

--- Comment #9 from Rafal Luzynski <digitalfreak at lingonborough dot com> ---
Created attachment 8795
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8795&action=edit
Proposed solution: alternative month names + smart algorithm

Good news: here is a working patch so please check, test, review, comment. It
implements the solution with "%B" format specifier smartly expanding into a
nominative or genitive (alternative) case depending on the current context. It
hopefully does not break any existing solution and is fully backward
compatible.

I have also provided the new locales for Polish, Russian and Ukrainian. I have
checked this with CLDR data but feel free to drop the changes to these files if
you think that other people should provide them. Please note that without the
changed locales you would not see the effect of the code change. For Russian I
have also changed the nominative month names to lowercase because some people
requested it here. For Ukrainian I have removed the "alternative digits" hack
and used the already provided genitive month names as the alternative names.

There are also some bad news:

1. The coreutils package (date, du) provides its own function fprintftime()
which tries to bypass strftime() as much as possible and if it calls strftime()
it retrieves only the month name so this patch will be unable to detect the
"full date" context and provide the correct genitive form. This means that
/usr/bin/date is not a good tool to test this patch. Perhaps it needs a patch
similar to this one.

2. I had to introduce the new locale field day_month_order which will be
available as nl_langinfo(_NL_DAY_MONTH_ORDER) and will determine if:
- only a day number before a month name forces the genitive month name (1),
- only a day number after a month name forces the genitive month name (3),
- both above orders force the genitive month name or this does not matter
because the current language does not provide the alternative month names (2,
default value when not specified).
Unfortunately, there is no universal rule for all languages. As stated in
comment 5, Russian requires a genitive case if a day number is before the month
name but a nominative case when reversed, both orders are correct. Other
languages require the day number to be before the month name and do not allow
to reverse them but we should not crash on grammatical errors, instead we
should provide the closest result to the requirement. On the other hand,
Lithuanian requires the month name to be before the day number and in the
genitive case.

3. There are more languages which suffer from this bug. It is possible to
retrieve the correct alternative month names from CLDR but I am not sure if
this task should be a part of this bugfix or should be left to the native
translators. I can provide more of them but providing all sounds like a
horrible task.

4. I am not sure if you like the idea of "%B" to be smartly converted to the
correct form of the month name. I will appreciate your feedback.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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