GNOME Bugzilla – Bug 518171
Use of ngettext()
Last modified: 2008-06-12 05:41:21 UTC
Please use ngettext() for strings excerpted below, i.e. merge them, so the plural form may display properly in many languages: #: ../src/gui/statusicon.cpp:349 #, c-format msgid "You have %d messages" # see the comment for 2838 line #: ../src/gui/statusicon.cpp:350 #, c-format msgid "You have %d message" Should be: msgid "You have %d message" msgid_plural "You have %d messages"
The given example is already fixed in HEAD: src/gui/statusicon.cpp:349 reads msg1 = g_strdup_printf (_("You have %d messages"), messages); msg2 = g_strdup_printf (_("You have %d message"), messages); message = ngettext (msg2, msg1, messages);
Shouldn't it be like the following instead? message = g_strdup_printf(ngettext ("You have %d messages", "You have %d message"), messages); The code you provide calls gettext two times...
Created attachment 112501 [details] [review] Correct usage of ngettext Steve is right. Here's the corresponding patch.
I didn't apply it directly, since it left unused variables, but the fix is in!