diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-30 01:34:16 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 20:00:07 +0100 |
commit | 1b1050da1c7b84cc72b7efbb2229294975be9e10 (patch) | |
tree | 68d15ccb015d58aeb5797ffd06efca3e55997c24 /src/net/tradehandler.cpp | |
parent | 0d4142a891cd228da24ee3aa3bbd7dc622da5b75 (diff) | |
parent | 955a7613d1fe116fe5e1da07a222b6849b3c885c (diff) | |
download | mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.gz mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.bz2 mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.tar.xz mana-1b1050da1c7b84cc72b7efbb2229294975be9e10.zip |
Merged with Aethyra master as of 2009-01-27
Conflicts:
Almost everywhere.
Diffstat (limited to 'src/net/tradehandler.cpp')
-rw-r--r-- | src/net/tradehandler.cpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index da493302..0c7c9205 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -19,10 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "tradehandler.h" - #include "messagein.h" #include "protocol.h" +#include "tradehandler.h" #include "../inventory.h" #include "../item.h" @@ -33,6 +32,8 @@ #include "../gui/confirm_dialog.h" #include "../gui/trade.h" +#include "../utils/gettext.h" + std::string tradePartnerName; /** @@ -87,9 +88,9 @@ void TradeHandler::handleMessage(MessageIn *msg) player_node->setTrading(true); ConfirmDialog *dlg; - dlg = new ConfirmDialog("Request for trade", + dlg = new ConfirmDialog(_("Request for trade"), tradePartnerName + - " wants to trade with you, do you accept?"); + _(" wants to trade with you, do you accept?")); dlg->addActionListener(&listener); } else @@ -103,37 +104,35 @@ void TradeHandler::handleMessage(MessageIn *msg) switch (msg->readInt8()) { case 0: // Too far away - chatWindow->chatLog("Trading isn't possible. " - "Trade partner is too far away.", + chatWindow->chatLog(_("Trading isn't possible. Trade partner is too far away."), BY_SERVER); break; case 1: // Character doesn't exist - chatWindow->chatLog("Trading isn't possible. " - "Character doesn't exist.", + chatWindow->chatLog(_("Trading isn't possible. Character doesn't exist."), BY_SERVER); break; case 2: // Invite request check failed... - chatWindow->chatLog("Trade cancelled due to an " - "unknown reason.", BY_SERVER); + chatWindow->chatLog(_("Trade cancelled due to an unknown reason."), + BY_SERVER); break; case 3: // Trade accepted tradeWindow->reset(); tradeWindow->setCaption( - "Trade: You and " + tradePartnerName); + _("Trade: You and ") + tradePartnerName); tradeWindow->setVisible(true); break; case 4: // Trade cancelled if (player_relations.hasPermission(tradePartnerName, PlayerRelation::SPEECH_LOG)) - chatWindow->chatLog("Trade with " + tradePartnerName + - " cancelled", BY_SERVER); + chatWindow->chatLog(_("Trade with ") + tradePartnerName + + _(" cancelled"), BY_SERVER); // otherwise ignore silently tradeWindow->setVisible(false); player_node->setTrading(false); break; default: // Shouldn't happen as well, but to be sure - chatWindow->chatLog("Unhandled trade cancel packet", + chatWindow->chatLog(_("Unhandled trade cancel packet"), BY_SERVER); break; } @@ -183,19 +182,17 @@ void TradeHandler::handleMessage(MessageIn *msg) break; case 1: // Add item failed - player overweighted - chatWindow->chatLog("Failed adding item. Trade " - "partner is over weighted.", + chatWindow->chatLog(_("Failed adding item. Trade partner is over weighted."), BY_SERVER); break; case 2: - // Add item failed - player has no free slot - chatWindow->chatLog("Failed adding item. Trade " - "partner has no free slot.", - BY_SERVER); - break; + // Add item failed - player has no free slot + chatWindow->chatLog(_("Failed adding item. Trade partner has no free slot."), + BY_SERVER); + break; default: - chatWindow->chatLog("Failed adding item for " - "unknown reason.", BY_SERVER); + chatWindow->chatLog(_("Failed adding item for unknown reason."), + BY_SERVER); break; } } @@ -207,14 +204,14 @@ void TradeHandler::handleMessage(MessageIn *msg) break; case SMSG_TRADE_CANCEL: - chatWindow->chatLog("Trade canceled.", BY_SERVER); + chatWindow->chatLog(_("Trade canceled."), BY_SERVER); tradeWindow->setVisible(false); tradeWindow->reset(); player_node->setTrading(false); break; case SMSG_TRADE_COMPLETE: - chatWindow->chatLog("Trade completed.", BY_SERVER); + chatWindow->chatLog(_("Trade completed."), BY_SERVER); tradeWindow->setVisible(false); tradeWindow->reset(); player_node->setTrading(false); |