After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 518171 - Use of ngettext()
Use of ngettext()
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: general
GIT master
Other All
: High minor
: ---
Assigned To: Jan Schampera
Ekiga maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-23 01:15 UTC by Petr Kovar
Modified: 2008-06-12 05:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correct usage of ngettext (759 bytes, patch)
2008-06-10 19:32 UTC, Claude Paroz
none Details | Review

Description Petr Kovar 2008-02-23 01:15:26 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"
Comment 1 Jan Schampera 2008-04-03 00:08:17 UTC
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);
Comment 2 Steve Frécinaux 2008-04-03 08:41:14 UTC
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...
Comment 3 Claude Paroz 2008-06-10 19:32:31 UTC
Created attachment 112501 [details] [review]
Correct usage of ngettext

Steve is right. Here's the corresponding patch.
Comment 4 Snark 2008-06-12 05:41:21 UTC
I didn't apply it directly, since it left unused variables, but the fix is in!