GNOME Bugzilla – Bug 106699
Please use ngettext for handling plurals in gnome-terminal
Last modified: 2004-12-22 21:47:04 UTC
#: src/terminal-profile.c:3080 #, c-format msgid "Palette had %d entries instead of %d\n" #: src/terminal.c:2477 msgid "Delete these two profiles?\n" #: src/terminal.c:2479 #, c-format msgid "Delete these %d profiles?\n" As mentioned in http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals, this way of handling plurals is broken for many locales. A way to solve this is by using ngettext instead as mentioned in that document. A simple code example of code using ngettext: g_printf (ngettext ("Found %d file.", "Found %d files.", nbr_of_files), nbr_of_files);
Created attachment 20158 [details] [review] Proposed patch. Making a distinction between two and two+n profiles is totally crappy.
Can we have this issue revisited now?
The following path uses ngettext in both instances. Is it any better?
Created attachment 20395 [details] [review] Same thing as before, now using , ngettext both times
Yes, I think the second patch is better. Reason is that msgid is extracted from the first parameter to ngettext, and that was empty string in the first patch, so we could expect some "undefined behaviour" (or at least a conflict with PO header which is actually msgid "").
Actually, the `Delete these %s profiles' was not using ngettext in the original patch...
Yes, quite correct — I've misread it for something else ;-) So, definitely, the second patch is what's wanted out of ngettext support.
Applied the 2nd patch to HEAD.
I think the 2nd patch just adds overhead: I didn't ngettextize the 2nd string since it's inside an if (count > 1) condition. Adding ngettext ("sth", "sth else", count) in there is no good, is it? regs, Chris
Manny, please see what I've said in bug 106700 -- this is required, it's not overhead. The singular form is really not required for english, but since it's used as msgid "" for that entry by gettext, it must be there; then, it's better that it sounds sane to translatora. Please mark this as FIXED, because it is fixed.
Well, it appears that pluralization in Slovenian has four special cases, not two: one for 1, and one for each set of numbers ending in 2, 3 and 4, respectively. So if the Slovenian translators are to be able to translate the sentence `Delete these %d profiles' correctly for all values of %d, we do need to use ngettext here, don't we? Note I do not speak/know anything about Slovenian: I have simply read the (GNOME?) Localization Guidelines for Developers (http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals). Marking as FIXED...
Mariano: You're right, the second ngettext is needed. I think Chris is thinking too much in the western "1 singular form and only 1 plural for anything > 1" way of handling plurals.