Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Gettext fixes
Browse files Browse the repository at this point in the history
And a Swedish translation of the desktop file.
  • Loading branch information
kess committed Jul 26, 2009
1 parent c7d5d82 commit c98665d
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ bool Engine::changeMap(const std::string &mapPath)
if (!newMap)
{
logger->log("Error while loading %s", map_path.c_str());
new OkDialog(_("Could not load map"),
new OkDialog(_("Could Not Load Map"),
strprintf(_("Error while loading %s"), map_path.c_str()));
}

Expand Down
8 changes: 4 additions & 4 deletions src/gui/buy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ BuyDialog::BuyDialog():
mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"),
"", ""));

mIncreaseButton = new Button("+", "+", this);
mDecreaseButton = new Button("-", "-", this);
mIncreaseButton = new Button(_("+"), "inc", this);
mDecreaseButton = new Button(_("-"), "dec", this);
mBuyButton = new Button(_("Buy"), "buy", this);
mQuitButton = new Button(_("Quit"), "quit", this);
mAddMaxButton = new Button(_("Max"), "max", this);
Expand Down Expand Up @@ -162,13 +162,13 @@ void BuyDialog::action(const gcn::ActionEvent &event)
mAmountItems = (int) mSlider->getValue();
updateButtonsAndLabels();
}
else if (event.getId() == "+" && mAmountItems < mMaxItems)
else if (event.getId() == "inc" && mAmountItems < mMaxItems)
{
mAmountItems++;
mSlider->setValue(mAmountItems);
updateButtonsAndLabels();
}
else if (event.getId() == "-" && mAmountItems > 1)
else if (event.getId() == "dec" && mAmountItems > 1)
{
mAmountItems--;
mSlider->setValue(mAmountItems);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/changeemaildialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ChangeEmailDialog::ChangeEmailDialog(Window *parent, LoginData *loginData):
{
gcn::Label *accountLabel = new Label(strprintf(_("Account: %s"),
mLoginData->username.c_str()));
gcn::Label *newEmailLabel = new Label(_("Type New Email Address twice:"));
gcn::Label *newEmailLabel = new Label(_("Type new email address twice:"));
mFirstEmailField = new TextField;
mSecondEmailField = new TextField;
mChangeEmailButton = new Button(_("Change Email Address"), "change_email", this);
Expand Down
8 changes: 4 additions & 4 deletions src/gui/charcreatedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ CharCreateDialog::CharCreateDialog(Window *parent, int slot):

mNameField = new TextField("");
mNameLabel = new Label(_("Name:"));
mNextHairColorButton = new Button(">", "nextcolor", this);
mPrevHairColorButton = new Button("<", "prevcolor", this);
mNextHairColorButton = new Button(_(">"), "nextcolor", this);
mPrevHairColorButton = new Button(_("<"), "prevcolor", this);
mHairColorLabel = new Label(_("Hair Color:"));
mNextHairStyleButton = new Button(">", "nextstyle", this);
mPrevHairStyleButton = new Button("<", "prevstyle", this);
mNextHairStyleButton = new Button(_(">"), "nextstyle", this);
mPrevHairStyleButton = new Button(_("<"), "prevstyle", this);
mHairStyleLabel = new Label(_("Hair Style:"));
mCreateButton = new Button(_("Create"), "create", this);
mCancelButton = new Button(_("Cancel"), "cancel", this);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ void ChatWindow::doPresent()
}
}

std::string cpc = strprintf(_("%d players are present."), playercount);
std::string log = _("Present: ") + response + std::string("; ") + cpc;
std::string log = strprintf(_("Present: %s; %d players are present."),
response.c_str(), playercount);

if (mRecorder->isRecording())
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/connectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "utils/gettext.h"

ConnectionDialog::ConnectionDialog(State previousState):
Window("Info"), mProgress(0), mPreviousState(previousState)
Window(_("Info")), mProgress(0), mPreviousState(previousState)
{
setContentSize(200, 100);

Expand Down
32 changes: 17 additions & 15 deletions src/gui/debugwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
#include "particle.h"
#include "map.h"

#include "utils/gettext.h"
#include "utils/stringutils.h"

DebugWindow::DebugWindow():
Window("Debug")
Window(_("Debug"))
{
setWindowName("Debug");
setupWindow->registerWindowForReset(this);
Expand All @@ -45,19 +46,19 @@ DebugWindow::DebugWindow():
setSaveVisible(true);
setDefaultSize(400, 100, ImageRect::CENTER);

mFPSLabel = new Label("0 FPS");
mMusicFileLabel = new Label("Music: ");
mMapLabel = new Label("Map: ");
mMiniMapLabel = new Label("Mini-Map: ");
mTileMouseLabel = new Label("Mouse: 0, 0");
mParticleCountLabel = new Label("Particle count: 0");
mFPSLabel = new Label(strprintf(_("%d FPS"), 0));
mMusicFileLabel = new Label(strprintf(_("Music: %s"), ""));
mMapLabel = new Label(strprintf(_("Map: %s"), ""));
mMinimapLabel = new Label(strprintf(_("Minimap: %s"), ""));
mTileMouseLabel = new Label(strprintf(_("Tile: (%d, %d)"), 0, 0));
mParticleCountLabel = new Label(strprintf(_("Particle Count: %d"), 0));

place(0, 0, mFPSLabel, 3);
place(3, 0, mTileMouseLabel);
place(0, 1, mMusicFileLabel, 3);
place(3, 1, mParticleCountLabel);
place(0, 2, mMapLabel, 4);
place(0, 3, mMiniMapLabel, 4);
place(0, 3, mMinimapLabel, 4);

loadWindowState();
}
Expand All @@ -71,27 +72,28 @@ void DebugWindow::logic()
int mouseTileX = (viewport->getMouseX() + viewport->getCameraX()) / 32;
int mouseTileY = (viewport->getMouseY() + viewport->getCameraY()) / 32;

mFPSLabel->setCaption(toString(fps) + " FPS");
mFPSLabel->setCaption(strprintf(_("%d FPS"), fps));

mTileMouseLabel->setCaption("Tile: (" + toString(mouseTileX) + ", " +
toString(mouseTileY) + ")");
mTileMouseLabel->setCaption(strprintf(_("Tile: (%d, %d)"), mouseTileX,
mouseTileY));

Map *currentMap = engine->getCurrentMap();
if (currentMap)
{
// TODO: Add gettext support below
const std::string music =
"Music: " + currentMap->getProperty("music");
mMusicFileLabel->setCaption(music);

const std::string minimap =
"MiniMap: " + currentMap->getProperty("minimap");
mMiniMapLabel->setCaption(minimap);
"Minimap: " + currentMap->getProperty("minimap");
mMinimapLabel->setCaption(minimap);

const std::string map =
"Map: " + currentMap->getProperty("_filename");
mMapLabel->setCaption(map);
}

mParticleCountLabel->setCaption("Particle count: " +
toString(Particle::particleCount));
mParticleCountLabel->setCaption(strprintf(_("Particle count: %d"),
Particle::particleCount));
}
2 changes: 1 addition & 1 deletion src/gui/debugwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DebugWindow : public Window
void logic();

private:
gcn::Label *mMusicFileLabel, *mMapLabel, *mMiniMapLabel;
gcn::Label *mMusicFileLabel, *mMapLabel, *mMinimapLabel;
gcn::Label *mTileMouseLabel, *mFPSLabel;
gcn::Label *mParticleCountLabel;
};
Expand Down
10 changes: 5 additions & 5 deletions src/gui/itemamount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item,
mItemIcon = new Icon(image);

// Buttons
Button *minusButton = new Button("-", "minus", this);
Button *plusButton = new Button("+", "plus", this);
Button *okButton = new Button(_("Ok"), "ok", this);
Button *minusButton = new Button(_("-"), "dec", this);
Button *plusButton = new Button(_("+"), "inc", this);
Button *okButton = new Button(_("OK"), "ok", this);
Button *cancelButton = new Button(_("Cancel"), "cancel", this);
Button *addAllButton = new Button(_("All"), "all", this);

Expand Down Expand Up @@ -172,11 +172,11 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
{
close();
}
else if (event.getId() == "plus" && amount < mMax)
else if (event.getId() == "inc" && amount < mMax)
{
amount++;
}
else if (event.getId() == "minus" && amount > 1)
else if (event.getId() == "dec" && amount > 1)
{
amount--;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Minimap::Minimap():
mWidthProportion(0.5),
mHeightProportion(0.5)
{
setWindowName("MiniMap");
setWindowName("Minimap");
mShow = config.getValue(getWindowName() + "Show", true);
setDefaultSize(5, 25, 100, 100);
// set this to false as the minimap window size is changed
Expand Down
8 changes: 4 additions & 4 deletions src/gui/npcdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ NpcDialog::NpcDialog()
mButton = new Button("", "ok", this);

//Setup more and less buttons (int input)
mPlusButton = new Button("+", "plus", this);
mMinusButton = new Button("-", "minus", this);
mPlusButton = new Button(_("+"), "inc", this);
mMinusButton = new Button(_("-"), "dec", this);

int width = std::max(mButton->getFont()->getWidth(CAPTION_WAITING),
mButton->getFont()->getWidth(CAPTION_NEXT));
Expand Down Expand Up @@ -211,11 +211,11 @@ void NpcDialog::action(const gcn::ActionEvent &event)
mIntField->setValue(mDefaultInt);
}
}
else if (event.getId() == "plus")
else if (event.getId() == "inc")
{
mIntField->setValue(mIntField->getValue() + 1);
}
else if (event.getId() == "minus")
else if (event.getId() == "dec")
{
mIntField->setValue(mIntField->getValue() - 1);
}
Expand Down
8 changes: 4 additions & 4 deletions src/gui/outfitwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ OutfitWindow::OutfitWindow():
setCloseButton(true);
setDefaultSize(250, 250, 118, 180); //160

mPreviousButton = new Button("<", "previous", this);
mNextButton = new Button(">", "next", this);
mCurrentLabel = new Label("Outfit: 1");
mPreviousButton = new Button(_("<"), "previous", this);
mNextButton = new Button(_(">"), "next", this);
mCurrentLabel = new Label(strprintf(_("Outfit: %d"), 1));
mCurrentLabel->setAlignment(gcn::Graphics::CENTER);
mUnequipCheck = new CheckBox(_("Unequip first"),
config.getValue("OutfitUnequip", true));
Expand Down Expand Up @@ -140,7 +140,7 @@ void OutfitWindow::action(const gcn::ActionEvent &event)
mCurrentOutfit = 9;
}
}
mCurrentLabel->setCaption("Outfit: " + toString(mCurrentOutfit + 1));
mCurrentLabel->setCaption(strprintf(_("Outfit: %d"), mCurrentOutfit + 1));
}

void OutfitWindow::wearOutfit(int outfit)
Expand Down
8 changes: 4 additions & 4 deletions src/gui/sell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ SellDialog::SellDialog():
mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"),
"", ""));

mIncreaseButton = new Button("+", "+", this);
mDecreaseButton = new Button("-", "-", this);
mIncreaseButton = new Button(_("+"), "inc", this);
mDecreaseButton = new Button(_("-"), "dec", this);
mSellButton = new Button(_("Sell"), "sell", this);
mQuitButton = new Button(_("Quit"), "quit", this);
mAddMaxButton = new Button(_("Max"), "max", this);
Expand Down Expand Up @@ -161,13 +161,13 @@ void SellDialog::action(const gcn::ActionEvent &event)
mAmountItems = (int) mSlider->getValue();
updateButtonsAndLabels();
}
else if (event.getId() == "+" && mAmountItems < mMaxItems)
else if (event.getId() == "inc" && mAmountItems < mMaxItems)
{
mAmountItems++;
mSlider->setValue(mAmountItems);
updateButtonsAndLabels();
}
else if (event.getId() == "-" && mAmountItems > 1)
else if (event.getId() == "dec" && mAmountItems > 1)
{
mAmountItems--;
mSlider->setValue(mAmountItems);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/serverdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void ServersListModel::addElement(Server server)
}

ServerDialog::ServerDialog(LoginData *loginData):
Window(_("Choose your server")), mLoginData(loginData)
Window(_("Choose Your Server")), mLoginData(loginData)
{
gcn::Label *serverLabel = new Label(_("Server:"));
gcn::Label *portLabel = new Label(_("Port:"));
Expand Down
2 changes: 1 addition & 1 deletion src/gui/skilldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ SkillEntry::SkillEntry(SkillInfo *info) :
mIcon(NULL),
mNameLabel(new Label(info->name)),
mLevelLabel(new Label("999")),
mIncrease(new Button("+", "inc", skillDialog)),
mIncrease(new Button(_("+"), "inc", skillDialog)),
mProgress(new ProgressBar(0.0f, 200, 20, gcn::Color(150, 150, 150)))
{
setFrameSize(1);
Expand Down
10 changes: 5 additions & 5 deletions src/gui/statuswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ StatusWindow::StatusWindow():
// Status Part
// ----------------------

mLvlLabel = new Label("Level:");
mMoneyLabel = new Label("Money:");
mLvlLabel = new Label(strprintf(_("Level: %d"), 0));
mMoneyLabel = new Label(strprintf(_("Money: %s"), ""));

mHpLabel = new Label("HP:");
mHpLabel = new Label(_("HP:"));
mHpBar = new ProgressBar((float) player_node->getHp()
/ (float) player_node->getMaxHp(),
80, 15, gcn::Color(0, 171, 34));
Expand Down Expand Up @@ -463,8 +463,8 @@ ChangeDisplay::ChangeDisplay(int id, const std::string &name):
AttrDisplay(id, name), mNeeded(1)
{
mPoints = new Label("1");
mDec = new Button("-", "-", this);
mInc = new Button("+", "+", this);
mDec = new Button(_("-"), "dec", this);
mInc = new Button(_("+"), "inc", this);
mDec->setWidth(mInc->getWidth());

// Do the layout
Expand Down
2 changes: 1 addition & 1 deletion src/gui/unregisterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <sstream>

UnRegisterDialog::UnRegisterDialog(Window *parent, LoginData *loginData):
Window("Unregister", true, parent),
Window(_("Unregister"), true, parent),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(loginData)
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/widgets/chattab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void ChatTab::chatLog(std::string line, int own, bool ignoreRecord)
lineColor = "##2"; // Equiv. to BrowserBox::GREEN
break;
case ACT_WHISPER:
tmp.nick = strprintf(_("%s whispers: "), tmp.nick.c_str());
tmp.nick = strprintf(_("%s whispers: %s"), tmp.nick.c_str(), "");
lineColor = "##W";
break;
case ACT_IS:
Expand Down
4 changes: 2 additions & 2 deletions src/net/ea/playerhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ void PlayerHandler::handleMessage(MessageIn &msg)
int curGp = player_node->getMoney();
player_node->setMoney(msg.readInt32());
if (player_node->getMoney() > curGp)
localChatTab->chatLog(_("You picked up ") +
localChatTab->chatLog(strprintf(_("You picked up %s"),
Units::formatCurrency(player_node->getMoney()
- curGp), BY_SERVER);
- curGp).c_str()), BY_SERVER);
}
break;
case 0x0016:
Expand Down
4 changes: 2 additions & 2 deletions src/net/tmwserv/beinghandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)

};
std::string message(deadMsg[rand()%13]);
message.append(_(" Press OK to respawn"));
OkDialog *dlg = new OkDialog(_("You died"), message);
message.append(" " + _("Press OK to respawn."));
OkDialog *dlg = new OkDialog(_("You Died"), message);
dlg->addActionListener(&(Net::GameServer::Player::respawnListener));
}
}
Expand Down
2 changes: 2 additions & 0 deletions tmw.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
Version=1.0
Name=The Mana World
Name[fr]=Le Monde de Mana
Name[sv]=Manavärlden
Comment=An on-line fantasy role playing game
Comment[fr]=Un jeu en ligne dans un univers fantastique
Comment[de]=ein Online Fantasy Spiel
Comment[it]=Un gioco fantasy online
Comment[nl]=Een online role playing game
Comment[sv]=Ett fantasyrollspel online
Exec=tmw
StartupNotify=false
Terminal=false
Expand Down

0 comments on commit c98665d

Please sign in to comment.