Bug 320780 (MONO78032) - Mono.Unix.Catalog handling of plurals insufficient
Summary: Mono.Unix.Catalog handling of plurals insufficient
Status: RESOLVED INVALID
Alias: MONO78032
Product: Mono: Class Libraries
Classification: Mono
Component: Mono.POSIX (show other bugs)
Version: unspecified
Hardware: Other All
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Miguel de Icaza
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2006-04-06 07:55 UTC by Ramon Casha
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:54:18 UTC


---- Reported by rcasha@waldonet.net.mt 2006-04-06 00:55:56 MST ----

The Mono.Unix.Catalog.GetPluralString does not cater for languages which
have more than one plural. For instance, in the Maltese language you can have:
tip 1 (1)
2 tipi (2-10)
11-il tip (11-19, 111-119 etc)
20 tip (all others)

There are various other languages in which there are more than one string
for plurals. Is there any chance for this to be handled, maybe like KDE
does it?



---- Additional Comments From jonpryor@vt.edu 2006-04-10 07:21:43 MST ----

Mono.Unix.Catalog is just a wrapper over ngettext(3), and ngettext(3)
only takes singular and plural string forms:

char * ngettext (const char * msgid, const char * msgid_plural,
                        unsigned long int n);

So it's not possible to do this while sticking with ngettext(3), and
the use of gettext (and gettext message catalogs) is the major point
to Catalog.

How does KDE handle this?  Does it handle things internally, or does
it use some gettext extension functions which I'm not aware of?



---- Additional Comments From rcasha@waldonet.net.mt 2006-04-11 01:23:43 MST ----

In KDE, each gettext string with a number-dependent variation places
each variation on a different line within the same string, so in
English a string might be:

"_n: %n replacement made.\n
%n replacements made."

The _n: at the beginning indicates that this gettext string has plural
forms. Then, each language has a predefined number of plural forms
along with a bit of code which selects the right line for that string.
 Thus for the Maltese language, the number of plurals is set to 4, and
the translation for the above string is:

"saret tibdila %n\n
saru %n tibdiliet\n
saru %n-il tibdila\n
saru %n tibdila"

A special gettext string in one of the .po files allows each language
to select its "type" of plural from a prefedined list.

Any idea whether this is handled for products like Gnome etc? I've
only done KDE so far, but languages like Croatian, Czech, Latvian,
Polish, Russian, Slovak, Slovenian and Ukrainian all need some kind of
special handling so I'm sure it's been tackled somehow.



---- Additional Comments From miguel@ximian.com 2006-04-11 13:24:23 MST ----

You describe a process by which plurals have to be tagged at the
source code, this is not a limitation of the API exposed, but a
cultural issue that needs to be raised with developers using the
actual routines.

This is not a bug.