diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-08 22:03:33 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-08 22:10:11 +0100 |
commit | 08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9 (patch) | |
tree | 3bcf862d1fb5c75bc71eea868f6bd9963c56b02c /src/gui/setup_players.cpp | |
parent | bbb89909e72ee1d1d5d8d469d505aff3bd5aa23c (diff) | |
download | mana-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.gz mana-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.bz2 mana-08a2e6eac1166f6fb22fd2058326ab1f72e5bdc9.tar.xz mana-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/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index c556a82d..122f54e1 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -30,6 +30,8 @@ #include "../log.h" #include "../sound.h" +#include "../utils/gettext.h" + #include <guichan/widgets/dropdown.hpp> #include <guichan/widgets/label.hpp> @@ -47,10 +49,16 @@ #define WIDGET_AT(row, column) (((row) * COLUMNS_NR) + column) -static std::string table_titles[COLUMNS_NR] = {"name", "relation"}; +static const char *table_titles[COLUMNS_NR] = { + N_("Name"), + N_("Relation") +}; -static const std::string RELATION_NAMES[PlayerRelation::RELATIONS_NR] = { - "neutral", "friend", "disregarded", "ignored" +static const char *RELATION_NAMES[PlayerRelation::RELATIONS_NR] = { + N_("Neutral"), + N_("Friend"), + N_("Disregarded"), + N_("Ignored") }; class PlayerRelationListModel : public gcn::ListModel @@ -67,7 +75,7 @@ public: { if (i >= getNumberOfElements() || i < 0) return ""; - return RELATION_NAMES[i]; + return gettext(RELATION_NAMES[i]); } }; @@ -136,7 +144,8 @@ public: virtual void updateModelInRow(int row) { - gcn::DropDown *choicebox = dynamic_cast<gcn::DropDown *>(getElementAt(row, RELATION_CHOICE_COLUMN)); + gcn::DropDown *choicebox = dynamic_cast<gcn::DropDown *>( + getElementAt(row, RELATION_CHOICE_COLUMN)); player_relations.setRelation(getPlayerAt(row), static_cast<PlayerRelation::relation>(choicebox->getSelected())); } @@ -202,21 +211,27 @@ Setup_Players::Setup_Players(): mPlayerTable(new GuiTable(mPlayerTableModel)), mPlayerTitleTable(new GuiTable(mPlayerTableTitleModel)), mPlayerScrollArea(new ScrollArea(mPlayerTable)), - mPersistIgnores(new CheckBox("save player list", player_relations.getPersistIgnores())), - mDefaultTrading(new CheckBox("allow trading", player_relations.getDefault() & PlayerRelation::TRADE)), - mDefaultWhisper(new CheckBox("allow whispers", player_relations.getDefault() & PlayerRelation::WHISPER)), - mDeleteButton(new Button("Delete", ACTION_DELETE, this)), + mPersistIgnores(new CheckBox(_("Save player list"), + player_relations.getPersistIgnores())), + mDefaultTrading(new CheckBox(_("Allow trading"), + player_relations.getDefault() & PlayerRelation::TRADE)), + mDefaultWhisper(new CheckBox(_("Allow whispers"), + player_relations.getDefault() & PlayerRelation::WHISPER)), + mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this)), mIgnoreActionChoicesBox(new gcn::DropDown(new IgnoreChoicesListModel())) { setOpaque(false); int table_width = NAME_COLUMN_WIDTH + RELATION_CHOICE_COLUMN_WIDTH; mPlayerTableTitleModel->fixColumnWidth(NAME_COLUMN, NAME_COLUMN_WIDTH); - mPlayerTableTitleModel->fixColumnWidth(RELATION_CHOICE_COLUMN, RELATION_CHOICE_COLUMN_WIDTH); + mPlayerTableTitleModel->fixColumnWidth(RELATION_CHOICE_COLUMN, + RELATION_CHOICE_COLUMN_WIDTH); mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width, 10)); mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf)); - for (int i = 0; i < COLUMNS_NR; i++) - mPlayerTableTitleModel->set(0, i, new gcn::Label(table_titles[i])); + for (int i = 0; i < COLUMNS_NR; i++) { + mPlayerTableTitleModel->set(0, i, + new gcn::Label(gettext(table_titles[i]))); + } mPlayerTitleTable->setLinewiseSelection(true); mPlayerScrollArea->setDimension(gcn::Rectangle(10, 25, table_width + COLUMNS_NR, 90)); @@ -227,7 +242,7 @@ Setup_Players::Setup_Players(): mDeleteButton->setPosition(10, 118); - gcn::Label *ignore_action_label = new gcn::Label("When ignoring:"); + gcn::Label *ignore_action_label = new gcn::Label(_("When ignoring:")); ignore_action_label->setPosition(80, 118); mIgnoreActionChoicesBox->setDimension(gcn::Rectangle(80, 132, 120, 12)); @@ -269,9 +284,9 @@ Setup_Players::~Setup_Players() void Setup_Players::reset() { - // We now have to search through the list of ignore choices to find the current - // selection. We could use an index into the table of config options in - // player_relations instead of strategies to sidestep this. + // We now have to search through the list of ignore choices to find the + // current selection. We could use an index into the table of config + // options in player_relations instead of strategies to sidestep this. int selection = 0; for (unsigned int i = 0; i < player_relations.getPlayerIgnoreStrategies()->size(); ++i) if ((*player_relations.getPlayerIgnoreStrategies())[i] == @@ -303,9 +318,10 @@ void Setup_Players::cancel() void Setup_Players::action(const gcn::ActionEvent &event) { if (event.getId() == ACTION_TABLE) { - // temporarily eliminate ourselves: we are fully aware of this change, so there is no - // need for asynchronous updates. (In fact, thouse might destroy the widet that - // triggered them, which would be rather embarrassing.) + // temporarily eliminate ourselves: we are fully aware of this change, + // so there is no need for asynchronous updates. (In fact, thouse + // might destroy the widet that triggered them, which would be rather + // embarrassing.) player_relations.removeListener(this); int row = mPlayerTable->getSelectedRow(); @@ -336,6 +352,8 @@ void Setup_Players::action(const gcn::ActionEvent &event) void Setup_Players::updatedPlayer(const std::string &name) { mPlayerTableModel->playerRelationsUpdated(); - mDefaultTrading->setSelected(player_relations.getDefault() & PlayerRelation::TRADE); - mDefaultWhisper->setSelected(player_relations.getDefault() & PlayerRelation::WHISPER); + mDefaultTrading->setSelected( + player_relations.getDefault() & PlayerRelation::TRADE); + mDefaultWhisper->setSelected( + player_relations.getDefault() & PlayerRelation::WHISPER); } |