public inbox for libc-locales@sourceware.org
 help / color / mirror / Atom feed
From: "digitalfreak at lingonborough dot com" <sourceware-bugzilla@sourceware.org>
To: libc-locales@sourceware.org
Subject: [Bug localedata/10871] ru_RU: 'mon' array should contain both nominative and genitive cases
Date: Wed, 28 Oct 2015 02:59:00 -0000	[thread overview]
Message-ID: <bug-10871-716-Qeae9mcYdg@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-10871-716@http.sourceware.org/bugzilla/>

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

Rafal Luzynski <digitalfreak at lingonborough dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |digitalfreak@lingonborough.
                   |                            |com

--- Comment #7 from Rafal Luzynski <digitalfreak at lingonborough dot com> ---
I'll be happy to provide a complete solution for this problem but some API
design questions must be answered first.

Please note that CLDR mentions only "standalone" version of the month name
which is probably always nominative, and "format" version which may be the same
as "standalone" (e.g., in English) but may be genitive in some languages, it
may also be another case in some other languages. For simplicity I will refer
to these cases as nominative/genitive keeping in mind that CLDR refers to them
as standalone/format. Also there may be languages which use other forms than
nominative/genitive but I think there are probably always at most two forms
since CLDR has decided to consider only two.


I. strftime() - http://linux.die.net/man/3/strftime

This function supports only one format which provides the full month name: %B.
At the moment there is no way for this function to provide multiple forms of
the full month name. Here are the API designs which would provide a full month
name:

1. Do not change the API, implement an internal algorithm which would analyze a
full format string and determine whether %B should format the month name in a
nominative or genitive case. The simplest algorithm would check if %d or %e
conversion specifiers are also present in the same format string, retrieve a
genitive case if they are, nominative otherwise. More advanced version could
check if the day and month conversion specifiers are adjacent, if they are
separated with other conversion specifiers, with space/punctuation/other
characters, if there are other letters concatenated with %B (which would mean
that the caller already tries to provide a workaround for this bug), if the
day/month order is correct (this is true only if day/month order is correct and
month/day order is incorrect in all these languages).

Pros:
- once implemented correctly it will automagically fix all affected
applications,
- even if the implementation will not be perfect for some languages the result
will not be worse than the one currently existing: it will not break any
currently correct application,
- if it turns out that this solution is completely wrong it will be easy to
revert it and provide another one because we don't change the API.

Cons:
- may be difficult to implement,
- it is questionable if a perfect algorithm exists for all affected languages,
even if we check it for all languages mentioned in the comment 6 there may be
other languages which we don't know about and which also require the
nominative/genitive case but use different rules,
- it is questionable how to handle the format strings which are incorrect from
grammatical point of view: please note that strftime() API does not and should
not say that there are illegal combination of the conversion specifiers.

2. Follow the specification already used in *BSD family (which also includes OS
X and iOS): https://www.freebsd.org/cgi/man.cgi?query=strftime&sektion=3. They
implement the %OB conversion specifier which retrieves the nominative case
while %B specifier retrieves the genitive case (sic!)

Pros:
- full portability between glibc and *BSD,
- simple and deterministic implementation,
- full programmer's control on whether they want a nominative or genitive case,
- will automagically fix all dates using %B conversion specifiers and
displaying the nominative case which is incorrect (full dates).

Cons:
- at the same time will break formatting of all dates using %B conversion
specifiers where the nominative case is required and is correctly provided now,
the application developer may not even be aware that the application became
broken in some languages,
- therefore will require urgent intervention from some application developers,
- it will be difficult or even impossible to provide a backward compatible
solution which would detect if the current runtime version of glibc requires
%OB or %B for the month name in nominative case,
- one may question if the *BSD decision to retrieve a genitive case from %B is
correct since it causes so much trouble.

3. Mimic the *BSD specification but implement it conversely: let %B retrieve
the nominative case (as it currently does) and let the new %OB specifier
retrieve the genitive case. See also:
http://austingroupbugs.net/view.php?id=258 - this seems to has accepted this
solution.

Pros:
- simple and deterministic implementation,
- full programmer's control on whether they want a nominative or genitive case,
- full backward compatibility,
- will not break any existing application.

Cons:
- portability with *BSD family will never be possible (format specifiers war),
- will require intervention from the application developers but it will not be
urgent because it will apply only the cases where they use %B explicitly and
this is already incorrect.

I would choose the first solution: not to change the API and try to provide a
smart algorithm which would determine if the month name retrieved by %B should
be nominative or genitive but I will listen to your opinion.


II. nl_langinfo() - http://linux.die.net/man/3/nl_langinfo

Although strftime() does not call nl_langinfo() directly both these functions
use the same backend database. We will need the new constants to be defined in
langinfo.h, for example ALTMON_{1-12} and their wide-character equivalents
_NL_WALTMON_{1-12}. This means it will affect the API of nl_langinfo() by
adding new valid argument values. Please note that I am talking in the context
of https://bugzilla.gnome.org/show_bug.cgi?id=749206 and the implementation of
g_date_time_printf() does call nl_langinfo() to retrieve the month names. I
hope it is valid to add these new symbols after _NL_TIME_CODESET and name them
ALTMON_{1-12} and _NL_WALTMON_{1-12}.

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

  parent reply	other threads:[~2015-10-28  2:59 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-10871-716@http.sourceware.org/bugzilla/>
2011-02-28  5:12 ` [Bug localedata/10871] Ru_RU month names are in incorrect form van.de.bugger at gmail dot com
2012-11-18  7:49 ` a.m.suharev at gmail dot com
2012-11-18 12:23 ` [Bug localedata/10871] ru_RU: 'mon' array should contain both nominative and genitive cases ldv at altlinux dot org
2013-06-11 20:57 ` piotrdrag at gmail dot com
2014-07-01  5:56 ` fweimer at redhat dot com
2014-07-01  5:56 ` fweimer at redhat dot com
2014-09-11  0:39 ` samos-project at meta dot ua
2014-09-11  1:57 ` samos-project at meta dot ua
2014-09-11  7:14 ` fweimer at redhat dot com
2015-10-28  2:59 ` digitalfreak at lingonborough dot com [this message]
2015-10-28 21:33 ` piotrdrag at gmail dot com
2015-11-19  1:56 ` digitalfreak at lingonborough dot com
2015-11-20 18:40 ` piotrdrag at gmail dot com
2015-11-26 23:50 ` digitalfreak at lingonborough dot com
2016-01-05  2:18 ` digitalfreak at lingonborough dot com
2016-01-05  2:29 ` digitalfreak at lingonborough dot com
2016-01-05  2:34 ` digitalfreak at lingonborough dot com
2016-01-05  2:39 ` digitalfreak at lingonborough dot com
2016-01-05  2:46 ` digitalfreak at lingonborough dot com
2016-01-05  2:54 ` digitalfreak at lingonborough dot com
2016-01-05  3:09 ` digitalfreak at lingonborough dot com
2016-01-08 21:03 ` vapier at gentoo dot org
2016-01-13 21:20 ` van.de.bugger at gmail dot com
2016-01-13 23:50 ` vapier at gentoo dot org
2016-01-14 12:38   ` Keld Simonsen
2016-01-14 12:40 ` keld at keldix dot com
2016-01-14 12:51 ` vapier at gentoo dot org
2016-01-14 13:31   ` Keld Simonsen
2016-01-14 13:34 ` keld at keldix dot com
2016-01-14 14:42 ` vapier at gentoo dot org
2016-01-17  0:23 ` van.de.bugger at gmail dot com
2016-01-17  2:22   ` Keld Simonsen
2016-01-17  0:29 ` van.de.bugger at gmail dot com
2016-01-17  2:11   ` Keld Simonsen
2016-01-17  1:06 ` van.de.bugger at gmail dot com
2016-01-17  2:12 ` keld at keldix dot com
2016-01-17  2:28 ` keld at keldix dot com
2016-01-17  8:07 ` kon at iki dot fi
2016-01-17 14:03 ` van.de.bugger at gmail dot com
2016-01-17 15:57   ` Egmont Koblinger
2016-01-17 14:39 ` piotrdrag at gmail dot com
2016-01-17 19:48 ` piotrdrag at gmail dot com
2016-01-17 19:48 ` van.de.bugger at gmail dot com
2016-01-17 22:42 ` van.de.bugger at gmail dot com
2016-01-18  1:31 ` kon at iki dot fi
2016-01-19  1:30 ` van.de.bugger at gmail dot com
2016-01-20  7:13 ` kon at iki dot fi
2016-01-20  8:02 ` kon at iki dot fi
2016-01-21 23:16 ` digitalfreak at lingonborough dot com
2016-01-23  7:27 ` kon at iki dot fi
2016-01-27 23:18 ` digitalfreak at lingonborough dot com
2016-01-31 10:51 ` samos-project at meta dot ua
2016-03-03 14:06 ` piotrdrag at gmail dot com
2016-03-04 22:33 ` digitalfreak at lingonborough dot com
2016-03-24 11:15 ` digitalfreak at lingonborough dot com
2016-03-24 11:17 ` digitalfreak at lingonborough dot com
2016-03-24 11:23 ` digitalfreak at lingonborough dot com
2016-03-24 11:24 ` digitalfreak at lingonborough dot com
2016-03-24 11:26 ` digitalfreak at lingonborough dot com
2016-03-24 11:26 ` digitalfreak at lingonborough dot com
2016-04-18  5:44 ` vapier at gentoo dot org
2016-08-24 10:37 ` piotrdrag at gmail dot com
2016-08-28 23:48 ` digitalfreak at lingonborough dot com
2016-10-18  0:31 ` digitalfreak at lingonborough dot com
2016-10-18  0:31 ` digitalfreak at lingonborough dot com
2016-10-18  0:31 ` digitalfreak at lingonborough dot com
2016-10-18  0:31 ` digitalfreak at lingonborough dot com
2016-10-18  0:32 ` joseph at codesourcery dot com
2016-10-18  0:32 ` digitalfreak at lingonborough dot com
2016-10-18  0:32 ` digitalfreak at lingonborough dot com
2016-10-18  0:32 ` digitalfreak at lingonborough dot com
2016-10-18  0:32 ` digitalfreak at lingonborough dot com
2016-10-18  0:33 ` digitalfreak at lingonborough dot com
2016-10-18  0:33 ` digitalfreak at lingonborough dot com
2016-10-18  0:33 ` digitalfreak at lingonborough dot com
2016-10-28  0:10 ` digitalfreak at lingonborough dot com
2016-10-28  0:10 ` digitalfreak at lingonborough dot com
2016-10-28  0:10 ` digitalfreak at lingonborough dot com
2016-10-28  0:10 ` digitalfreak at lingonborough dot com
2016-10-28  0:10 ` digitalfreak at lingonborough dot com
2016-12-22 23:06 ` digitalfreak at lingonborough dot com
2016-12-22 23:10 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:34 ` digitalfreak at lingonborough dot com
2016-12-22 23:35 ` digitalfreak at lingonborough dot com
2016-12-22 23:35 ` digitalfreak at lingonborough dot com
2016-12-22 23:40 ` digitalfreak at lingonborough dot com
2017-03-20  8:48 ` digitalfreak at lingonborough dot com
2017-03-20  8:51 ` digitalfreak at lingonborough dot com
2017-03-20  8:58 ` digitalfreak at lingonborough dot com
2017-03-20  9:02 ` digitalfreak at lingonborough dot com
2017-03-20  9:11   ` Keld Simonsen
2017-03-20  9:05 ` digitalfreak at lingonborough dot com
2017-03-20  9:14 ` keld at keldix dot com
2017-03-20  9:14 ` digitalfreak at lingonborough dot com
2017-03-20 10:39 ` digitalfreak at lingonborough dot com
2017-03-20 10:40 ` digitalfreak at lingonborough dot com
2017-03-20 10:40 ` digitalfreak at lingonborough dot com
2017-03-20 10:40 ` digitalfreak at lingonborough dot com
2017-03-20 10:40 ` digitalfreak at lingonborough dot com
2017-03-20 10:40 ` digitalfreak at lingonborough dot com
2017-03-20 10:41 ` digitalfreak at lingonborough dot com
2017-04-12  8:15 ` fweimer at redhat dot com
2017-05-23 23:35 ` digitalfreak at lingonborough dot com
2017-05-23 23:35 ` digitalfreak at lingonborough dot com
2017-05-23 23:35 ` digitalfreak at lingonborough dot com
2017-06-28  0:59 ` digitalfreak at lingonborough dot com
2017-06-28  0:59 ` digitalfreak at lingonborough dot com
2017-06-28  1:00 ` digitalfreak at lingonborough dot com
2017-06-28  1:00 ` digitalfreak at lingonborough dot com
2017-06-28  1:00 ` digitalfreak at lingonborough dot com
2017-06-28  1:00 ` digitalfreak at lingonborough dot com
2017-06-28  1:00 ` digitalfreak at lingonborough dot com
2017-09-19 10:10 ` digitalfreak at lingonborough dot com
2017-09-19 10:13 ` digitalfreak at lingonborough dot com
2017-09-19 10:18 ` digitalfreak at lingonborough dot com
2017-09-19 10:19 ` digitalfreak at lingonborough dot com
2017-09-19 10:20 ` digitalfreak at lingonborough dot com
2017-09-19 10:23 ` digitalfreak at lingonborough dot com
2017-09-22 12:01 ` digitalfreak at lingonborough dot com
2017-11-16  1:49 ` digitalfreak at lingonborough dot com
2017-11-16  1:52 ` digitalfreak at lingonborough dot com
2017-11-16  1:53 ` digitalfreak at lingonborough dot com
2017-11-16  1:55 ` digitalfreak at lingonborough dot com
2017-11-16  2:01 ` digitalfreak at lingonborough dot com
2017-11-16  2:03 ` digitalfreak at lingonborough dot com
2017-11-16  2:04 ` digitalfreak at lingonborough dot com
2017-11-16  2:05 ` digitalfreak at lingonborough dot com
2017-11-16  2:06 ` digitalfreak at lingonborough dot com
2017-11-16  2:08 ` digitalfreak at lingonborough dot com
2017-11-16  2:09 ` digitalfreak at lingonborough dot com
2017-12-06  1:08 ` [Bug locale/10871] " digitalfreak at lingonborough dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-10871-716-Qeae9mcYdg@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libc-locales@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).