diff options
author | Kess Vargavind <vargavind@gmail.com> | 2009-07-17 14:31:36 +0200 |
---|---|---|
committer | Kess Vargavind <vargavind@gmail.com> | 2009-07-17 15:21:53 +0200 |
commit | 8b0a65f00c0e5afb2c177462acd30013afa99b64 (patch) | |
tree | e34427ff57870c0e96065ccdacd296e9dddd445a /src | |
parent | 18aaa873abcaa617bbd296f73138d062423662b8 (diff) | |
download | mana-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.gz mana-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.bz2 mana-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.xz mana-8b0a65f00c0e5afb2c177462acd30013afa99b64.zip |
Various gettext fixes
* Merged a few split strings
* Fixed some spellings and wordings
* Turned a couple of std::cout and std::cerr into logger messages
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/changeemaildialog.cpp | 18 | ||||
-rw-r--r-- | src/gui/changepassworddialog.cpp | 19 | ||||
-rw-r--r-- | src/gui/guildwindow.cpp | 20 | ||||
-rw-r--r-- | src/gui/itempopup.cpp | 5 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 3 | ||||
-rw-r--r-- | src/gui/register.cpp | 14 | ||||
-rw-r--r-- | src/gui/setup_audio.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.cpp | 10 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 22 | ||||
-rw-r--r-- | src/gui/unregisterdialog.cpp | 17 | ||||
-rw-r--r-- | src/gui/updatewindow.cpp | 5 | ||||
-rw-r--r-- | src/localplayer.cpp | 19 | ||||
-rw-r--r-- | src/main.cpp | 52 | ||||
-rw-r--r-- | src/net/ea/network.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwserv/charserverhandler.cpp | 38 | ||||
-rw-r--r-- | src/net/tmwserv/loginhandler.cpp | 2 |
16 files changed, 133 insertions, 119 deletions
diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index d36ab487..362c7e17 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -114,29 +114,29 @@ ChangeEmailDialog::action(const gcn::ActionEvent &event) logger->log("ChangeEmailDialog::Email change, Username is %s", username.c_str()); - std::stringstream errorMsg; + std::stringstream errorMessage; int error = 0; if (newFirstEmail.length() < LEN_MIN_PASSWORD) { // First email address too short - errorMsg << "The new email address needs to be at least " - << LEN_MIN_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The new email address needs to be at " + "least %d characters long."), + LEN_MIN_PASSWORD); error = 1; } else if (newFirstEmail.length() > LEN_MAX_PASSWORD - 1 ) { // First email address too long - errorMsg << "The new email address needs to be less than " - << LEN_MAX_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The new email address needs to be " + "less than %d characters long."), + LEN_MAX_PASSWORD); error = 1; } else if (newFirstEmail != newSecondEmail) { // Second Pass mismatch - errorMsg << "The email address entries mismatch."; + errorMessage << _("The email address entries mismatch."); error = 2; } @@ -151,7 +151,7 @@ ChangeEmailDialog::action(const gcn::ActionEvent &event) mWrongDataNoticeListener->setTarget(this->mSecondEmailField); } - OkDialog *dlg = new OkDialog("Error", errorMsg.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp index 4be92b15..9d66d13a 100644 --- a/src/gui/changepassworddialog.cpp +++ b/src/gui/changepassworddialog.cpp @@ -96,36 +96,35 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event) logger->log("ChangePasswordDialog::Password change, Username is %s", username.c_str()); - std::stringstream errorMsg; + std::stringstream errorMessage; int error = 0; // Check old Password if (oldPassword.empty()) { // No old password - errorMsg << "Enter the old Password first."; + errorMessage << _("Enter the old password first."); error = 1; } else if (newFirstPass.length() < LEN_MIN_PASSWORD) { // First password too short - errorMsg << "The new password needs to be at least " - << LEN_MIN_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The new password needs to be at least " + "%d characters long."), LEN_MIN_PASSWORD); error = 2; } else if (newFirstPass.length() > LEN_MAX_PASSWORD - 1 ) { // First password too long - errorMsg << "The new password needs to be less than " - << LEN_MAX_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The new password needs to be less " + "than %d characters long."), + LEN_MAX_PASSWORD); error = 2; } else if (newFirstPass != newSecondPass) { // Second Pass mismatch - errorMsg << "The new password entries mismatch."; + errorMessage << _("The new password entries mismatch."); error = 3; } @@ -144,7 +143,7 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event) mWrongDataNoticeListener->setTarget(this->mSecondPassField); } - OkDialog *dlg = new OkDialog("Error", errorMsg.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/guildwindow.cpp b/src/gui/guildwindow.cpp index 6dc86e13..1fc1d7fe 100644 --- a/src/gui/guildwindow.cpp +++ b/src/gui/guildwindow.cpp @@ -41,6 +41,7 @@ #include "utils/dtor.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include <algorithm> @@ -110,7 +111,8 @@ void GuildWindow::action(const gcn::ActionEvent &event) { // Set focus so that guild name to be created can be typed. mFocus = true; - guildDialog = new TextDialog("Guild Name", "Choose your guild's name", this); + guildDialog = new TextDialog(_("Guild Name"), + _("Choose your guild's name"), this); guildDialog->setOKButtonActionId("CREATE_GUILD_OK"); guildDialog->addActionListener(this); } @@ -118,7 +120,8 @@ void GuildWindow::action(const gcn::ActionEvent &event) { // TODO - Give feedback on whether the invite succeeded mFocus = true; - inviteDialog = new TextDialog("Member Invite", "Who would you like to invite?", this); + inviteDialog = new TextDialog(_("Member Invite"), + _("Who would you like to invite?"), this); inviteDialog->setOKButtonActionId("INVITE_USER_OK"); inviteDialog->addActionListener(this); } @@ -128,7 +131,8 @@ void GuildWindow::action(const gcn::ActionEvent &event) if (guild) { Net::ChatServer::Guild::quitGuild(guild); - localChatTab->chatLog("Guild " + mGuildTabs->getSelectedTab()->getCaption() + " quit", BY_SERVER); + localChatTab->chatLog(strprintf(_("Guild %s quit"), + mGuildTabs->getSelectedTab()->getCaption().c_str()), BY_SERVER); } } else if (eventId == "CREATE_GUILD_OK") @@ -144,7 +148,8 @@ void GuildWindow::action(const gcn::ActionEvent &event) // Defocus dialog mFocus = false; - localChatTab->chatLog("Creating Guild called " + name, BY_SERVER); + localChatTab->chatLog(strprintf(_("Creating Guild called %s"), + name.c_str()), BY_SERVER); guildDialog->scheduleDelete(); } else if (eventId == "INVITE_USER_OK") @@ -157,7 +162,7 @@ void GuildWindow::action(const gcn::ActionEvent &event) // Defocus dialog mFocus = false; - localChatTab->chatLog("Invited user " + name, BY_SERVER); + localChatTab->chatLog(strprintf(_("Invited user %s"), name.c_str()), BY_SERVER); inviteDialog->scheduleDelete(); } else if (eventId == "yes") @@ -233,10 +238,11 @@ short GuildWindow::getSelectedGuild() void GuildWindow::openAcceptDialog(const std::string &inviterName, const std::string &guildName) { - std::string msg = inviterName + " has invited you to join the guild " + guildName; + std::string msg = strprintf(_("%s has invited you to join the guild %s"), + inviterName.c_str(), guildName.c_str()); localChatTab->chatLog(msg, BY_SERVER); - acceptDialog = new ConfirmDialog("Accept Guild Invite", msg, this); + acceptDialog = new ConfirmDialog(_("Accept Guild Invite"), msg, this); acceptDialog->addActionListener(this); invitedGuild = guildName; diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index e1822e03..39dc603a 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -88,8 +88,9 @@ void ItemPopup::setItem(const ItemInfo &item) mItemDesc->setTextWrapped(item.getDescription(), 196); mItemEffect->setTextWrapped(item.getEffect(), 196); - mItemWeight->setTextWrapped(_("Weight: ") + - Units::formatWeight(item.getWeight()), 196); + mItemWeight->setTextWrapped(strprintf(_("Weight: %s"), + Units::formatWeight(item.getWeight()).c_str()), + 196); int minWidth = mItemName->getWidth(); diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index e12ca822..60ee7353 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -34,6 +34,7 @@ #include "graphics.h" #include "item.h" #include "localplayer.h" +#include "log.h" #include "npc.h" #include "playerrelations.h" @@ -332,7 +333,7 @@ void PopupMenu::handleLink(const std::string &link) // Unknown actions else if (link != "cancel") { - std::cout << link << std::endl; + logger->log("PopupMenu: Warning, unknown action '%s'", link.c_str()); } setVisible(false); diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 2b897641..f1313a5e 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -160,13 +160,13 @@ void RegisterDialog::action(const gcn::ActionEvent &event) const std::string user = mUserField->getText(); logger->log("RegisterDialog::register Username is %s", user.c_str()); - std::string errorMsg; + std::string errorMessage; int error = 0; if (user.length() < LEN_MIN_USERNAME) { // Name too short - errorMsg = strprintf + errorMessage = strprintf (_("The username needs to be at least %d characters long."), LEN_MIN_USERNAME); error = 1; @@ -174,7 +174,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (user.length() > LEN_MAX_USERNAME - 1 ) { // Name too long - errorMsg = strprintf + errorMessage = strprintf (_("The username needs to be less than %d characters long."), LEN_MAX_USERNAME); error = 1; @@ -182,7 +182,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() < LEN_MIN_PASSWORD) { // Pass too short - errorMsg = strprintf + errorMessage = strprintf (_("The password needs to be at least %d characters long."), LEN_MIN_PASSWORD); error = 2; @@ -190,7 +190,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() > LEN_MAX_PASSWORD - 1 ) { // Pass too long - errorMsg = strprintf + errorMessage = strprintf (_("The password needs to be less than %d characters long."), LEN_MAX_PASSWORD); error = 2; @@ -198,7 +198,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText() != mConfirmField->getText()) { // Password does not match with the confirmation one - errorMsg = _("Passwords do not match."); + errorMessage = _("Passwords do not match."); error = 2; } @@ -219,7 +219,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) mWrongDataNoticeListener->setTarget(this->mPasswordField); } - OkDialog *dlg = new OkDialog(_("Error"), errorMsg); + OkDialog *dlg = new OkDialog(_("Error"), errorMessage); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp index 9da74c2e..990a3ce8 100644 --- a/src/gui/setup_audio.cpp +++ b/src/gui/setup_audio.cpp @@ -91,7 +91,7 @@ void Setup_Audio::apply() } catch (const char *err) { - new OkDialog("Sound Engine", err); + new OkDialog(_("Sound Engine"), err); logger->log("Warning: %s", err); } } diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index efa03ba4..110ef534 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -68,7 +68,7 @@ Setup_Colors::Setup_Colors() : mPreviewBox->setScrollPolicy(gcn::ScrollArea::SHOW_NEVER, gcn::ScrollArea::SHOW_NEVER); - mGradTypeLabel = new Label(_("Type: ")); + mGradTypeLabel = new Label(_("Type:")); mGradTypeSlider = new Slider(0, 3); mGradTypeSlider->setWidth(200); @@ -90,7 +90,7 @@ Setup_Colors::Setup_Colors() : mGradTypeText->setCaption(longText); - mGradDelayLabel = new Label(_("Delay: ")); + mGradDelayLabel = new Label(_("Delay:")); mGradDelayText = new TextField(); mGradDelayText->setWidth(40); @@ -105,7 +105,7 @@ Setup_Colors::Setup_Colors() : mGradDelaySlider->addActionListener(this); mGradDelaySlider->setEnabled(false); - mRedLabel = new Label(_("Red: ")); + mRedLabel = new Label(_("Red:")); mRedText = new TextField; mRedText->setWidth(40); @@ -120,7 +120,7 @@ Setup_Colors::Setup_Colors() : mRedSlider->addActionListener(this); mRedSlider->setEnabled(false); - mGreenLabel = new Label(_("Green: ")); + mGreenLabel = new Label(_("Green:")); mGreenText = new TextField; mGreenText->setWidth(40); @@ -135,7 +135,7 @@ Setup_Colors::Setup_Colors() : mGreenSlider->addActionListener(this); mGreenSlider->setEnabled(false); - mBlueLabel = new Label(_("Blue: ")); + mBlueLabel = new Label(_("Blue:")); mBlueText = new TextField; mBlueText->setWidth(40); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index a9c892b2..ce815001 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -192,7 +192,7 @@ Setup_Video::Setup_Video(): mVisibleNamesEnabled)), mParticleEffectsCheckBox(new CheckBox(_("Particle effects"), mParticleEffectsEnabled)), - mNameCheckBox(new CheckBox(_("Show name"), mNameEnabled)), + mNameCheckBox(new CheckBox(_("Show own name"), mNameEnabled)), mPickupNotifyLabel(new Label(_("Show pickup notification"))), mPickupChatCheckBox(new CheckBox(_("in chat"), mPickupChatEnabled)), mPickupParticleCheckBox(new CheckBox(_("as particle"), @@ -352,12 +352,20 @@ void Setup_Video::apply() fullscreen = !fullscreen; if (!graphics->setFullscreen(fullscreen)) { - std::stringstream error; - error << _("Failed to switch to ") << - (fullscreen ? _("windowed") : _("fullscreen")) << - _("mode and restoration of old mode also failed!") << - std::endl; - logger->error(error.str()); + std::stringstream errorMessage; + if (fullscreen) + { + errorMessage << _("Failed to switch to windowed mode " + "and restoration of old mode also " + "failed!") << std::endl; + } + else + { + errorMessage << _("Failed to switch to fullscreen mode " + "and restoration of old mode also " + "failed!") << std::endl; + } + logger->error(errorMessage.str()); } } #if defined(WIN32) || defined(__APPLE__) diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 048239c5..32bc732f 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -102,24 +102,23 @@ UnRegisterDialog::action(const gcn::ActionEvent &event) logger->log("UnregisterDialog::unregistered, Username is %s", username.c_str()); - std::stringstream errorMsg; + std::stringstream errorMessage; bool error = false; // Check password if (password.length() < LEN_MIN_PASSWORD) { // Pass too short - errorMsg << "The password needs to be at least " - << LEN_MIN_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The password needs to be at least %d " + "characters long."), LEN_MIN_PASSWORD); error = true; } - else if (password.length() > LEN_MAX_PASSWORD - 1 ) + else if (password.length() > LEN_MAX_PASSWORD - 1) { // Pass too long - errorMsg << "The password needs to be less than " - << LEN_MAX_PASSWORD - << " characters long."; + errorMessage << strprintf(_("The password needs to be less than " + "%d characters long."), + LEN_MAX_PASSWORD); error = true; } @@ -127,7 +126,7 @@ UnRegisterDialog::action(const gcn::ActionEvent &event) { mWrongDataNoticeListener->setTarget(this->mPasswordField); - OkDialog *dlg = new OkDialog("Error", errorMsg.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 21362630..6ea5e1ca 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -322,9 +322,8 @@ int UpdaterWindow::downloadThread(void *ptr) { case CURLE_COULDNT_CONNECT: default: - std::cerr << _("curl error ") << res << ": " - << uw->mCurlError << _(" host: ") << url.c_str() - << std::endl; + logger->log("curl error %d: %s host: %s", + res, uw->mCurlError, url.c_str()); break; } diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 18bc77b0..970204d0 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -869,15 +869,24 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, int amount) } else { - // TRANSLATORS: Used as in "You picked up a ...", when picking up - // only one item. const std::string amountStr = (amount > 1) ? toString(amount) : _("a"); if (config.getValue("showpickupchat", 1)) { - localChatTab->chatLog(strprintf(_("You picked up %s [@@%d|%s@@]."), - amountStr.c_str(), itemInfo.getId(), - itemInfo.getName().c_str()), BY_SERVER); + if (amount == 1) + { + // TRANSLATORS: Used as in "You picked up a [Candy]", when + // picking up only one item. + localChatTab->chatLog(strprintf(_("You picked up a [@@%d|%s@@]."), + itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); + } + else + { + // TRANSLATORS: Used as in "You picked up 4 [Candy]", when + // picking up more than one item. + localChatTab->chatLog(strprintf(_("You picked up %d [@@%d|%s@@]."), + amount, itemInfo.getId(), itemInfo.getName().c_str()), BY_SERVER); + } } if (mMap && config.getValue("showpickupparticle", 0)) diff --git a/src/main.cpp b/src/main.cpp index 3ea8aa2d..6dd6ba6b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -260,7 +260,7 @@ static void setUpdatesDir() else { logger->log("Error: Invalid update host: %s", updateHost.c_str()); - errorMessage = _("Invalid update host: ") + updateHost; + errorMessage = strprintf(_("Invalid update host: %s"), updateHost.c_str()); state = STATE_ERROR; } } @@ -335,10 +335,8 @@ static void initHomeDir(const Options &options) (errno != EEXIST)) #endif { - std::cout << homeDir - << _(" can't be created, but it doesn't exist! Exiting.") - << std::endl; - exit(1); + logger->error(strprintf(_("%s doesn't exist and can't be created! " + "Exiting."), homeDir.c_str())); } } @@ -389,8 +387,7 @@ static void initConfiguration(const Options &options) configFile = fopen(configPath.c_str(), "wt"); } if (configFile == NULL) { - std::cout << "Can't create " << configPath << ". " - << "Using Defaults." << std::endl; + logger->log("Can't create %s. Using defaults.", configPath.c_str()); } else { fclose(configFile); config.init(configPath); @@ -405,9 +402,8 @@ static void initEngine(const Options &options) // Initialize SDL logger->log("Initializing SDL..."); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { - std::cerr << "Could not initialize SDL: " << - SDL_GetError() << std::endl; - exit(1); + logger->error(strprintf("Could not initialize SDL: %s", + SDL_GetError())); } atexit(SDL_Quit); @@ -420,10 +416,8 @@ static void initEngine(const Options &options) ResourceManager *resman = ResourceManager::getInstance(); if (!resman->setWriteDir(homeDir)) { - std::cout << homeDir - << " couldn't be set as home directory! Exiting." - << std::endl; - exit(1); + logger->error(strprintf("%s couldn't be set as home directory! " + "Exiting.", homeDir.c_str())); } // Add the user's homedir to PhysicsFS search path @@ -489,10 +483,8 @@ static void initEngine(const Options &options) // Try to set the desired video mode if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel)) { - std::cerr << _("Couldn't set ") - << width << "x" << height << "x" << bpp << _(" video mode: ") - << SDL_GetError() << std::endl; - exit(1); + logger->error(strprintf("Couldn't set %dx%dx%d video mode: %s", + width, height, bpp, SDL_GetError())); } // Initialize for drawing @@ -1160,7 +1152,7 @@ int main(int argc, char *argv[]) case STATE_LOGIN_ERROR: logger->log("State: LOGIN ERROR"); - currentDialog = new OkDialog("Error ", errorMessage); + currentDialog = new OkDialog(_("Error"), errorMessage); currentDialog->addActionListener(&loginListener); currentDialog = NULL; // OkDialog deletes itself break; @@ -1214,8 +1206,8 @@ int main(int argc, char *argv[]) case STATE_CHANGEEMAIL: logger->log("State: CHANGE EMAIL"); - currentDialog = new OkDialog("Email Address change", - "Email Address changed successfully!"); + currentDialog = new OkDialog(_("Email Address Change"), + _("Email address changed successfully!")); currentDialog->addActionListener(&accountListener); currentDialog = NULL; // OkDialog deletes itself loginData.email = loginData.newEmail; @@ -1231,8 +1223,8 @@ int main(int argc, char *argv[]) case STATE_CHANGEPASSWORD: logger->log("State: CHANGE PASSWORD"); - currentDialog = new OkDialog("Password change", - "Password changed successfully!"); + currentDialog = new OkDialog(_("Password Change"), + _("Password changed successfully!")); currentDialog->addActionListener(&accountListener); currentDialog = NULL; // OkDialog deletes itself loginData.password = loginData.newPassword; @@ -1248,8 +1240,8 @@ int main(int argc, char *argv[]) case STATE_UNREGISTER: logger->log("State: UNREGISTER"); accountServerConnection->disconnect(); - currentDialog = new OkDialog("Unregister successful", - "Farewell, come back any time ...."); + currentDialog = new OkDialog(_("Unregister Successful"), + _("Farewell, come back any time...")); loginData.clear(); //The errorlistener sets the state to STATE_CHOOSE_SERVER currentDialog->addActionListener(&errorListener); @@ -1258,7 +1250,7 @@ int main(int argc, char *argv[]) case STATE_ACCOUNTCHANGE_ERROR: logger->log("State: ACCOUNT CHANGE ERROR"); - currentDialog = new OkDialog("Error ", errorMessage); + currentDialog = new OkDialog(_("Error"), errorMessage); currentDialog->addActionListener(&accountListener); currentDialog = NULL; // OkDialog deletes itself break; @@ -1266,7 +1258,7 @@ int main(int argc, char *argv[]) case STATE_ERROR: logger->log("State: ERROR"); - currentDialog = new OkDialog("Error", errorMessage); + currentDialog = new OkDialog(_("Error"), errorMessage); currentDialog->addActionListener(&errorListener); currentDialog = NULL; // OkDialog deletes itself gameServerConnection->disconnect(); @@ -1555,8 +1547,8 @@ int main(int argc, char *argv[]) case STATE_CHANGEPASSWORD: logger->log("State: CHANGE PASSWORD"); - currentDialog = new OkDialog("Password change", - "Password changed successfully!"); + currentDialog = new OkDialog(_("Password Change"), + _("Password changed successfully!")); currentDialog->addActionListener(&accountListener); currentDialog = NULL; // OkDialog deletes itself loginData.password = loginData.newPassword; @@ -1565,7 +1557,7 @@ int main(int argc, char *argv[]) case STATE_ACCOUNTCHANGE_ERROR: logger->log("State: ACCOUNT CHANGE ERROR"); - currentDialog = new OkDialog("Error ", errorMessage); + currentDialog = new OkDialog(_("Error"), errorMessage); currentDialog->addActionListener(&accountListener); currentDialog = NULL; // OkDialog deletes itself break; diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 956d7877..c6bc712c 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -318,9 +318,9 @@ bool Network::realConnect() if (SDLNet_ResolveHost(&ipAddress, mAddress.c_str(), mPort) == -1) { - std::string error = "Unable to resolve host \"" + mAddress + "\""; - setError(error); - logger->log("SDLNet_ResolveHost: %s", error.c_str()); + std::string errorMessage = "Unable to resolve host \"" + mAddress + "\""; + setError(errorMessage); + logger->log("SDLNet_ResolveHost: %s", errorMessage.c_str()); return false; } diff --git a/src/net/tmwserv/charserverhandler.cpp b/src/net/tmwserv/charserverhandler.cpp index 7b74904f..010c49d5 100644 --- a/src/net/tmwserv/charserverhandler.cpp +++ b/src/net/tmwserv/charserverhandler.cpp @@ -81,25 +81,25 @@ void CharServerHandler::handleMessage(MessageIn &msg) delete mCharInfo->getEntry(); mCharInfo->setEntry(0); mCharInfo->unlock(); - new OkDialog("Info", "Player deleted"); + new OkDialog(_("Info"), _("Player deleted")); } // Character deletion failed else { - std::string message = ""; + std::string errorMessage = ""; switch (errMsg) { case ERRMSG_NO_LOGIN: - message = "Not logged in"; + errorMessage = _("Not logged in"); break; case ERRMSG_INVALID_ARGUMENT: - message = "Selection out of range"; + errorMessage = _("Selection out of range"); break; default: - message = "Unknown error"; + errorMessage = _("Unknown error"); } mCharInfo->unlock(); - new OkDialog("Error", message); + new OkDialog(_("Error"), errorMessage); } } break; @@ -131,44 +131,44 @@ void CharServerHandler::handleCharCreateResponse(MessageIn &msg) // Character creation failed if (errMsg != ERRMSG_OK) { - std::string message = ""; + std::string errorMessage = ""; switch (errMsg) { case ERRMSG_NO_LOGIN: - message = "Not logged in"; + errorMessage = _("Not logged in"); break; case CREATE_TOO_MUCH_CHARACTERS: - message = "No empty slot"; + errorMessage = _("No empty slot"); break; case ERRMSG_INVALID_ARGUMENT: - message = "Invalid name"; + errorMessage = _("Invalid name"); break; case CREATE_EXISTS_NAME: - message = "Character's name already exists"; + errorMessage = _("Character's name already exists"); break; case CREATE_INVALID_HAIRSTYLE: - message = "Invalid hairstyle"; + errorMessage = _("Invalid hairstyle"); break; case CREATE_INVALID_HAIRCOLOR: - message = "Invalid hair color"; + errorMessage = _("Invalid hair color"); break; case CREATE_INVALID_GENDER: - message = "Invalid gender"; + errorMessage = _("Invalid gender"); break; case CREATE_RAW_STATS_TOO_HIGH: - message = "Character's stats are too high"; + errorMessage = _("Character's stats are too high"); break; case CREATE_RAW_STATS_TOO_LOW: - message = "Character's stats are too low"; + errorMessage = _("Character's stats are too low"); break; case CREATE_RAW_STATS_EQUAL_TO_ZERO: - message = "One stat is zero"; + errorMessage = _("One stat is zero"); break; default: - message = "Unknown error"; + errorMessage = _("Unknown error"); break; } - new OkDialog("Error", message); + new OkDialog(_("Error"), errorMessage); } if (mCharCreateDialog) diff --git a/src/net/tmwserv/loginhandler.cpp b/src/net/tmwserv/loginhandler.cpp index 35739669..4f14a635 100644 --- a/src/net/tmwserv/loginhandler.cpp +++ b/src/net/tmwserv/loginhandler.cpp @@ -146,7 +146,7 @@ void LoginHandler::handleMessage(MessageIn &msg) errorMessage = _("Account not connected. Please login first."); break; case ERRMSG_EMAIL_ALREADY_EXISTS: - errorMessage = _("The new Email Address already exists."); + errorMessage = _("The new email address already exists."); break; default: errorMessage = _("Unknown error"); |