summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorKess Vargavind <vargavind@gmail.com>2009-07-17 14:31:36 +0200
committerKess Vargavind <vargavind@gmail.com>2009-07-17 15:21:53 +0200
commit8b0a65f00c0e5afb2c177462acd30013afa99b64 (patch)
treee34427ff57870c0e96065ccdacd296e9dddd445a /src/gui
parent18aaa873abcaa617bbd296f73138d062423662b8 (diff)
downloadmana-client-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.gz
mana-client-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.bz2
mana-client-8b0a65f00c0e5afb2c177462acd30013afa99b64.tar.xz
mana-client-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/gui')
-rw-r--r--src/gui/changeemaildialog.cpp18
-rw-r--r--src/gui/changepassworddialog.cpp19
-rw-r--r--src/gui/guildwindow.cpp20
-rw-r--r--src/gui/itempopup.cpp5
-rw-r--r--src/gui/popupmenu.cpp3
-rw-r--r--src/gui/register.cpp14
-rw-r--r--src/gui/setup_audio.cpp2
-rw-r--r--src/gui/setup_colors.cpp10
-rw-r--r--src/gui/setup_video.cpp22
-rw-r--r--src/gui/unregisterdialog.cpp17
-rw-r--r--src/gui/updatewindow.cpp5
11 files changed, 74 insertions, 61 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;
}