summaryrefslogtreecommitdiff
path: root/src/gui/setup.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/setup.cpp
parenta570ee66c7cf6ddff7b0c124ad4b633b4651bdb3 (diff)
downloadmana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.gz
mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.bz2
mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.xz
mana-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/setup.cpp')
-rw-r--r--src/gui/setup.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index a61d3bb2..73023eba 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -33,6 +33,7 @@
#include "tabbedcontainer.h"
#include "../utils/dtor.h"
+#include "../utils/gettext.h"
extern Window *chatWindow;
extern Window *equipmentWindow;
@@ -52,19 +53,19 @@ Setup::Setup():
int height = 310;
setContentSize(width, height);
- const char *buttonNames[] = {
- "Apply", "Cancel", "Reset Windows", 0
+ static const char *buttonNames[] = {
+ N_("Apply"), N_("Cancel"), N_("Reset Windows"), 0
};
int x = width;
for (const char **curBtn = buttonNames; *curBtn; ++curBtn)
{
- Button *btn = new Button(*curBtn, *curBtn, this);
+ Button *btn = new Button(gettext(*curBtn), *curBtn, this);
x -= btn->getWidth() + 5;
btn->setPosition(x, height - btn->getHeight() - 5);
add(btn);
// Disable this button when the windows aren't created yet
- if (!strcmp(*curBtn, "Reset Windows"))
+ if (!strcmp(*curBtn, _("Reset Windows")))
btn->setEnabled(statusWindow != NULL);
}
@@ -75,27 +76,27 @@ Setup::Setup():
SetupTab *tab;
tab = new Setup_Video();
- panel->addTab(tab, "Video");
+ panel->addTab(tab, _("Video"));
mTabs.push_back(tab);
tab = new Setup_Audio();
- panel->addTab(tab, "Audio");
+ panel->addTab(tab, _("Audio"));
mTabs.push_back(tab);
tab = new Setup_Joystick();
- panel->addTab(tab, "Joystick");
+ panel->addTab(tab, _("Joystick"));
mTabs.push_back(tab);
tab = new Setup_Keyboard();
- panel->addTab(tab, "Keyboard");
+ panel->addTab(tab, _("Keyboard"));
mTabs.push_back(tab);
tab = new Setup_Colours();
- panel->addTab(tab, "Colours");
+ panel->addTab(tab, _("Colours"));
mTabs.push_back(tab);
tab = new Setup_Players();
- panel->addTab(tab, "Players");
+ panel->addTab(tab, _("Players"));
mTabs.push_back(tab);
add(panel);
@@ -110,17 +111,17 @@ Setup::~Setup()
void Setup::action(const gcn::ActionEvent &event)
{
- if (event.getId() == "Apply")
+ if (event.getId() == _("Apply"))
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::apply));
}
- else if (event.getId() == "Cancel")
+ else if (event.getId() == _("Cancel"))
{
setVisible(false);
for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::cancel));
}
- else if (event.getId() == "Reset Windows")
+ else if (event.getId() == _("Reset Windows"))
{
// Bail out if this action happens to be activated before the windows
// are created (though it should be disabled then)