From 7681c909322c65356bac25a334c16650dddde687 Mon Sep 17 00:00:00 2001 From: Kess Vargavind Date: Tue, 4 Aug 2009 12:28:32 +0200 Subject: Gettext plural support, step one Step two (updating the headers in all po files) should preferably wait till importing from Launchpad and updating the po files. --- src/localplayer.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 18510f49..57dc8981 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -918,24 +918,14 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount) } else { - const std::string amountStr = (amount > 1) ? toString(amount) : _("a"); - if (config.getValue("showpickupchat", 1)) { - if (amount == 1) - { - // TRANSLATORS: Used as in "You picked up a [Candy]", when - // picking up only one item. - localChatTab->chatLog(strprintf(_("You picked up a [@@%d|%s@@]."), - itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); - } - else - { - // TRANSLATORS: Used as in "You picked up 4 [Candy]", when - // picking up more than one item. - localChatTab->chatLog(strprintf(_("You picked up %d [@@%d|%s@@]."), - amount, itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); - } + // TRANSLATORS: This sentence may be translated differently + // for different grammatical numbers (singular, plural, ...) + localChatTab->chatLog(strprintf(ngettext("You picked up %d " + "[@@%d|%s@@].", "You picked up %d [@@%d|%s@@].", amount), + amount, itemInfo.getId(), itemInfo.getName().c_str()), + BY_SERVER); } if (mMap && config.getValue("showpickupparticle", 0)) -- cgit v1.2.3-70-g09d2