summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-06 13:52:30 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-06 15:50:02 +0100
commitbfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706 (patch)
treeb30134f93042e4afb5554b5f14a83528ed2ef069 /src/gui/popupmenu.cpp
parentce0d7b62824d620ec8c3daceac5710fbbd6b12f1 (diff)
downloadmana-client-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.gz
mana-client-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.bz2
mana-client-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.tar.xz
mana-client-bfd1d1bcc2a6ecd7efe301bfbf22a1e9b9188706.zip
Added support for internationalization
Merged from the mainline client. Originally implemented by Guillaume Melquiond, starting with commit 1828eee6a6d91fd385ad1e69d93044516493aa91.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 07719d2c..bfa75ef9 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -42,6 +42,9 @@
#include "../resources/iteminfo.h"
#include "../resources/itemdb.h"
+#include "../utils/gettext.h"
+#include "../utils/strprintf.h"
+
extern std::string tradePartnerName;
PopupMenu::PopupMenu():
@@ -74,8 +77,10 @@ void PopupMenu::showPopup(int x, int y, Being *being)
// Players can be traded with. Later also attack, follow and
// add as buddy will be options in this menu.
const std::string &name = being->getName();
- mBrowserBox->addRow("@@trade|Trade With " + name + "@@");
- mBrowserBox->addRow("@@attack|Attack " + name + "@@");
+ mBrowserBox->addRow(
+ strprintf(_("@@trade|Trade With %s@@"), name.c_str()));
+ mBrowserBox->addRow(
+ strprintf(_("@@attack|Attack %s@@"), name.c_str()));
mBrowserBox->addRow("##3---");
@@ -106,7 +111,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
case Being::NPC:
// NPCs can be talked to (single option, candidate for removal
// unless more options would be added)
- mBrowserBox->addRow("@@talk|Talk To NPC@@");
+ mBrowserBox->addRow(_("@@talk|Talk To NPC@@"));
break;
default:
@@ -116,7 +121,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
//browserBox->addRow("@@look|Look To@@");
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow("@@cancel|Cancel@@");
+ mBrowserBox->addRow(_("@@cancel|Cancel@@"));
showPopup(x, y);
}
@@ -128,11 +133,11 @@ void PopupMenu::showPopup(int x, int y, FloorItem *floorItem)
// Floor item can be picked up (single option, candidate for removal)
std::string name = ItemDB::get(mFloorItem->getItemId()).getName();
- mBrowserBox->addRow("@@pickup|Pick Up " + name + "@@");
+ mBrowserBox->addRow(strprintf(_("@@pickup|Pick Up %s@@"), name.c_str()));
//browserBox->addRow("@@look|Look To@@");
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow("@@cancel|Cancel@@");
+ mBrowserBox->addRow(_("@@cancel|Cancel@@"));
showPopup(x, y);
}
@@ -275,17 +280,17 @@ void PopupMenu::showPopup(int x, int y, Item *item)
if (item->isEquipment())
{
if (item->isEquipped())
- mBrowserBox->addRow("@@use|Unequip@@");
+ mBrowserBox->addRow(_("@@use|Unequip@@"));
else
- mBrowserBox->addRow("@@use|Equip@@");
+ mBrowserBox->addRow(_("@@use|Equip@@"));
}
else
- mBrowserBox->addRow("@@use|Use@@");
+ mBrowserBox->addRow(_("@@use|Use@@"));
- mBrowserBox->addRow("@@drop|Drop@@");
- mBrowserBox->addRow("@@description|Description@@");
+ mBrowserBox->addRow(_("@@drop|Drop@@"));
+ mBrowserBox->addRow(_("@@description|Description@@"));
mBrowserBox->addRow("##3---");
- mBrowserBox->addRow("@@cancel|Cancel@@");
+ mBrowserBox->addRow(_("@@cancel|Cancel@@"));
showPopup(x, y);
}