summaryrefslogtreecommitdiff
path: root/src/gui/menuwindow.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-06 10:20:36 -0700
committerIra Rice <irarice@gmail.com>2009-01-06 10:20:36 -0700
commit2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251 (patch)
treed4bee5fa8cb866618995e666ce1fdf37ca174f3b /src/gui/menuwindow.cpp
parenta570ee66c7cf6ddff7b0c124ad4b633b4651bdb3 (diff)
downloadmana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.gz
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.bz2
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.xz
mana-client-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.zip
Added support for internationalization
Merged from the mainline client. Originally implemented by Guillaume Melquiond, starting with commit 1828eee6a6d91fd385ad1e69d93044516493aa91. Conflicts: INSTALL configure.ac src/Makefile.am src/gui/buy.cpp src/gui/confirm_dialog.cpp src/gui/inventorywindow.cpp src/gui/login.cpp src/gui/menuwindow.cpp src/gui/minimap.cpp src/gui/ok_dialog.cpp src/gui/popupmenu.cpp src/gui/register.cpp src/gui/sell.cpp src/gui/setup.cpp src/gui/setup_video.cpp Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/menuwindow.cpp')
-rw-r--r--src/gui/menuwindow.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp
index 56bc48fd..99eaca34 100644
--- a/src/gui/menuwindow.cpp
+++ b/src/gui/menuwindow.cpp
@@ -27,6 +27,8 @@
#include "menuwindow.h"
#include "windowcontainer.h"
+#include "../utils/gettext.h"
+
extern Window *chatWindow;
extern Window *equipmentWindow;
extern Window *inventoryWindow;
@@ -55,23 +57,23 @@ MenuWindow::MenuWindow():
setTitleBarHeight(0);
// Buttons
- const char *buttonNames[] =
+ static const char *buttonNames[] =
{
- "Chat",
- "Status",
- "Equipment",
- "Inventory",
- "Skills",
- "Shortcut",
- "Emote",
- "Setup",
+ _("Chat"),
+ _("Status"),
+ _("Equipment"),
+ _("Inventory"),
+ _("Skills"),
+ _("Shortcut"),
+ _("Emote"),
+ _("Setup"),
0
};
int x = 0, h = 0;
for (const char **curBtn = buttonNames; *curBtn; curBtn++)
{
- gcn::Button *btn = new Button(*curBtn, *curBtn, &listener);
+ gcn::Button *btn = new Button(gettext(*curBtn), *curBtn, &listener);
btn->setPosition(x, 0);
add(btn);
x += btn->getWidth() + 3;
@@ -92,35 +94,35 @@ void MenuWindowListener::action(const gcn::ActionEvent &event)
{
Window *window = NULL;
- if (event.getId() == "Chat")
+ if (event.getId() == _("Chat"))
{
window = chatWindow;
}
- else if (event.getId() == "Status")
+ else if (event.getId() == _("Status"))
{
window = statusWindow;
}
- else if (event.getId() == "Equipment")
+ else if (event.getId() == _("Equipment"))
{
window = equipmentWindow;
}
- else if (event.getId() == "Inventory")
+ else if (event.getId() == _("Inventory"))
{
window = inventoryWindow;
}
- else if (event.getId() == "Skills")
+ else if (event.getId() == _("Skills"))
{
window = skillDialog;
}
- else if (event.getId() == "Shortcut")
+ else if (event.getId() == _("Shortcut"))
{
window = itemShortcutWindow;
}
- else if (event.getId() == "Emote")
+ else if (event.getId() == _("Emote"))
{
window = smileyWindow;
}
- else if (event.getId() == "Setup")
+ else if (event.getId() == _("Setup"))
{
window = setupWindow;
}