summaryrefslogtreecommitdiff
path: root/src/gui/skill.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-08 22:03:33 +0100
committerIra Rice <irarice@gmail.com>2009-01-08 16:27:30 -0700
commit193ccbdba8031a351ea622f8842b6d9a0b6cfd43 (patch)
tree5e62faa24be231e60a3aa2643fa233f356ac23c7 /src/gui/skill.cpp
parent3f8387402ee7b528026450232cb457c8ae1cf4e2 (diff)
downloadmana-client-193ccbdba8031a351ea622f8842b6d9a0b6cfd43.tar.gz
mana-client-193ccbdba8031a351ea622f8842b6d9a0b6cfd43.tar.bz2
mana-client-193ccbdba8031a351ea622f8842b6d9a0b6cfd43.tar.xz
mana-client-193ccbdba8031a351ea622f8842b6d9a0b6cfd43.zip
Made remaining dialogs translatable
Most strings are now translatable. Please do report any missing ones. Strings excluded from translation are anything that gets written to the log file or is otherwise not shown in the GUI. Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/skill.cpp')
-rw-r--r--src/gui/skill.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 321a6c52..5e5782d9 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -32,9 +32,11 @@
#include "../log.h"
#include "../utils/dtor.h"
+#include "../utils/gettext.h"
+#include "../utils/strprintf.h"
#include "../utils/xml.h"
-#define SKILLS_FILE "skills.xml"
+static const char *SKILLS_FILE = "skills.xml";
struct SkillInfo {
std::string name;
@@ -77,7 +79,7 @@ public:
virtual void
update(void)
{
- static const SkillInfo fakeSkillInfo = { "???", false };
+ static const SkillInfo fakeSkillInfo = { _("???"), false };
mEntriesNr = mDialog->getSkills().size();
resize();
@@ -94,13 +96,13 @@ public:
info = &fakeSkillInfo;
sprintf(tmp, "%c%s", info->modifiable? ' ' : '*', info->name.c_str());
- gcn::Label *name_label = new gcn::Label(std::string(tmp));
+ gcn::Label *name_label = new gcn::Label(tmp);
sprintf(tmp, "Lv:%i", skill->lv);
- gcn::Label *lv_label = new gcn::Label(std::string(tmp));
+ gcn::Label *lv_label = new gcn::Label(tmp);
sprintf(tmp, "Sp:%i", skill->sp);
- gcn::Label *sp_label = new gcn::Label(std::string(tmp));
+ gcn::Label *sp_label = new gcn::Label(tmp);
set(i, 0, name_label);
set(i, 1, lv_label);
@@ -116,22 +118,22 @@ private:
SkillDialog::SkillDialog():
- Window("Skills")
+ Window(_("Skills"))
{
initSkillinfo();
mTableModel = new SkillGuiTableModel(this);
mTable.setModel(mTableModel);
mTable.setLinewiseSelection(true);
- setWindowName("Skills");
+ setWindowName(_("Skills"));
setCloseButton(true);
setDefaultSize(windowContainer->getWidth() - 260, 25, 255, 260);
// mSkillListBox = new ListBox(this);
- skillScrollArea = new ScrollArea(&mTable);
- mPointsLabel = new gcn::Label("Skill Points:");
- mIncButton = new Button("Up", "inc", this);
- mUseButton = new Button("Use", "use", this);
+ ScrollArea *skillScrollArea = new ScrollArea(&mTable);
+ mPointsLabel = new gcn::Label(strprintf(_("Skill points: %d"), 0));
+ mIncButton = new Button(_("Up"), _("inc"), this);
+ mUseButton = new Button(_("Use"), _("use"), this);
mUseButton->setEnabled(false);
// mSkillListBox->setActionEventId("skill");
@@ -185,11 +187,8 @@ void SkillDialog::action(const gcn::ActionEvent &event)
void SkillDialog::update()
{
- if (mPointsLabel != NULL) {
- char tmp[128];
- sprintf(tmp, "Skill points: %i", player_node->mSkillPoint);
- mPointsLabel->setCaption(tmp);
- }
+ mPointsLabel->setCaption(strprintf(_("Skill points: %d"),
+ player_node->mSkillPoint));
int selectedSkill = mTable.getSelectedRow();
@@ -260,8 +259,7 @@ initSkillinfo(void)
if (!root || !xmlStrEqual(root->name, BAD_CAST "skills"))
{
- logger->log("Error loading skills file: "
- SKILLS_FILE);
+ logger->log(_("Error loading skills file: %s"), SKILLS_FILE);
skill_db.resize(2, emptySkillInfo);
skill_db[1].name = "Basic";
skill_db[1].modifiable = true;