GNOME Bugzilla – Bug 522334
ngettext() required for numeric places
Last modified: 2008-03-14 11:00:00 UTC
This is in POT file: #. Translators: The accuracy range will always be plural, so no need to #. * use ngettext here. #. #: ../gcalctool/gtk.c:549 #, c-format msgid "Set accuracy from 0 to %d numeric places." msgstr "" The problem is that actual translation of this message depends on number in %d. For example in Slovak language we would have translated: "4 places" as "4 miesta" "5 places" as "5 miest" Please, use ngettext() for this message too to allow proper translation of this message to Slovak. Thank you.
Marcel, I need some advice here. For GNOME 2.22, the code in gtk.c for this used to be: desc = g_strdup_printf(ngettext("Set accuracy from 0 to %d numeric places.", "Set accuracy from 0 to %d numeric places.", MAXACC), MAXACC); But we had another bug (bug #520269) saying that: From the current POT file: #: ../gcalctool/gtk.c:546 msgid "Set accuracy from 0 to %d numeric places." msgid_plural "Set accuracy from 0 to %d numeric places." ... The singular and plural cases are the same, and I don't think this is correct. Surely the singular should be "place"? So which is it? Should both parts of the ngettext say: "Set accuracy from 0 to %d numeric places.", "Set accuracy from 0 to %d numeric places.", or should it be: "Set accuracy from 0 to %d numeric place.", "Set accuracy from 0 to %d numeric places.", ? Thanks.
The documentation for ngettext() is saying: -- Function: char * ngettext (const char *MSGID1, const char *MSGID2, unsigned long int N) The `ngettext' function is similar to the `gettext' function as it finds the message catalogs in the same way. But it takes two extra arguments. The MSGID1 parameter must contain the singular form of the string to be converted. It is also used as the key for the search in the catalog. The MSGID2 parameter is the plural form. The parameter N is used to determine the plural form. If no message catalog is found MSGID1 is returned if `n == 1', otherwise `msgid2'. So, you should use place/places variant to avoid confusion and questions in future. Even if you are sure that you are never going to use singular form of the string. This is the right way. Links: http://live.gnome.org/TranslationProject/DevGuidelines/Plurals
Created attachment 107288 [details] [review] Patch to hopefully fix the problem. > So, you should use place/places variant to avoid confusion and questions in > future. Even if you are sure that you are never going to use singular form of > the string. This is the right way. Okay. So changed. It just feels wrong to me. Patch committed to SVN trunk. Closing as FIXED. Thanks.