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 #19 from van.de.bugger at gmail dot com ---
(In reply to Rafal Luzynski from comment #7)

Thanks for a good analysis. However, I do not agree with your approach. 

> 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. 

This is a bad idea. You left programmer with no control over the result. For
example: someone used format string like "This is %B" (I used English, but
imagine another language, like Polish). Later his decided to include day
number: "This is %B, today is day #%e." Since %B remains intact, programmer
would assume the first part of the message remains intact too, but "artificial
intelligence" may have own opinion and change case of month name depending on
presence or absence of %e or whatever else. To me this is not acceptable.

Also, month name is not the only name in strftime. Look at %A â it's weekday
name, which also has multiple forms/cases.

> 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.

This is not *BSD but POSIX:

http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html

Description of strftime is not very clear what "alternative representation" and
"alternative numeric symbols", but 

http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html

adds some details. Both of %O and %E are not for changing case of month name.

Thus, I will propose an extension, dedicated for the problem. Current
conversion specifier looks like:

"%" flag width [ modifier ] format

where "%" and "." are literal strings; flag â one of GNU flags: "-", "_", "0",
"^" (see "info strftime"), width is a positive integer,  modifier is either "E"
or "O", format â one of documented letters (a, b, B, c, C, ...).

Extension may utilize syntax of "precision" used in "printf", e. g.:

"%" flag width [ "." precision ] [ modifier ] format

in "strftime" precision = grammatic case number. In case of Russian "precision"
would be in range 1..6 (since in Russian language nouns have 6 cases):

%.1B â month name in nominative case
%.2B â month name in accusative case
%.3B â month name in genitive case
%.4B â month name in dative case
%.5B â month name in instrumental case
%.6B â month name in prepositional case

Note that this is universal and can be used with week day names too:

%.1A, %.2A, etc.

"Precision" zero (".0") is used as default (when case is not specified) and as
fallback (when specified "precision" is out of range for current locale).

"Precision" can be combined with width: %20.1B.

In such a case strftime maintains compatibility â behaviour of existing
programs is not affected, but in new (versions of the) programs developers are
free to specify case of names precisely.

-- 
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]