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
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-08 22:10:11 +0100
commit08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9 (patch)
tree3bcf862d1fb5c75bc71eea868f6bd9963c56b02c /src/gui/skill.cpp
parentbbb89909e72ee1d1d5d8d469d505aff3bd5aa23c (diff)
downloadmana-client-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.gz
mana-client-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.bz2
mana-client-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.xz
mana-client-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.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.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 82108f84..8b8c58cd 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -29,12 +29,14 @@
#include "windowcontainer.h"
#include "../localplayer.h"
+#include "../log.h"
#include "../utils/dtor.h"
+#include "../utils/gettext.h"
+#include "../utils/strprintf.h"
#include "../utils/xml.h"
-#include "../log.h"
-#define SKILLS_FILE "skills.xml"
+static const char *SKILLS_FILE = "skills.xml";
struct SkillInfo {
std::string name;
@@ -73,7 +75,10 @@ public:
virtual void update()
{
- static const SkillInfo fakeSkillInfo = { "Mystery Skill", false };
+ static const SkillInfo fakeSkillInfo = {
+ _("Mystery Skill"),
+ false
+ };
mEntriesNr = mDialog->getSkills().size();
resize();
@@ -90,13 +95,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);
@@ -111,7 +116,7 @@ private:
SkillDialog::SkillDialog():
- Window("Skills")
+ Window(_("Skills"))
{
initSkillinfo();
mTableModel = new SkillGuiTableModel(this);
@@ -124,9 +129,9 @@ SkillDialog::SkillDialog():
// mSkillListBox = new ListBox(this);
ScrollArea *skillScrollArea = new ScrollArea(&mTable);
- mPointsLabel = new gcn::Label("Skill Points:");
- mIncButton = new Button("Up", "inc", this);
- mUseButton = new Button("Use", "use", this);
+ 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");
@@ -180,11 +185,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();
@@ -254,8 +256,7 @@ static void initSkillinfo()
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;