diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-10 23:08:35 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-11 08:43:59 -0700 |
commit | 1ea7d80aff0961e6f55ee467b8cbe26d146828f8 (patch) | |
tree | 4e635e72541c3df3493a2a5871348f02b9f48bfe | |
parent | 4a41ce55224ad7b54c6b5ea78126d8d314f5ef41 (diff) | |
download | Mana-1ea7d80aff0961e6f55ee467b8cbe26d146828f8.tar.gz Mana-1ea7d80aff0961e6f55ee467b8cbe26d146828f8.tar.bz2 Mana-1ea7d80aff0961e6f55ee467b8cbe26d146828f8.tar.xz Mana-1ea7d80aff0961e6f55ee467b8cbe26d146828f8.zip |
Don't make log statements translatable
The log is mainly used to aid the developers, hence shouldn't be
translated to the user's local language. Also introduces unnecessary
work for all translators.
-rw-r--r-- | po/POTFILES.in | 2 | ||||
-rw-r--r-- | src/game.cpp | 10 | ||||
-rw-r--r-- | src/gui/register.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 4 | ||||
-rw-r--r-- | src/gui/skill.cpp | 2 | ||||
-rw-r--r-- | src/gui/updatewindow.cpp | 8 | ||||
-rw-r--r-- | src/main.cpp | 42 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 8 | ||||
-rw-r--r-- | src/resources/colordb.cpp | 11 | ||||
-rw-r--r-- | src/resources/emotedb.cpp | 9 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 16 | ||||
-rw-r--r-- | src/resources/monsterdb.cpp | 23 | ||||
-rw-r--r-- | src/resources/npcdb.cpp | 6 |
13 files changed, 73 insertions, 70 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index 1b3dea84..9a2cf604 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -50,8 +50,6 @@ src/net/loginhandler.cpp src/net/maploginhandler.cpp src/net/playerhandler.cpp src/net/tradehandler.cpp -src/resources/colordb.cpp -src/resources/emotedb.cpp src/resources/itemdb.cpp src/resources/monsterdb.cpp src/resources/npcdb.cpp diff --git a/src/game.cpp b/src/game.cpp index 9b11fad2..bc0c86b5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -389,7 +389,7 @@ static bool saveScreenshot() else { chatWindow->chatLog(_("Saving screenshot failed!"), BY_SERVER); - logger->log(_("Error: could not save screenshot.")); + logger->log("Error: could not save screenshot."); } SDL_FreeSurface(screenshot); @@ -595,9 +595,9 @@ void Game::handleInput() case KeyboardConfig::KEY_QUIT: if (!exitConfirm) { - exitConfirm = new ConfirmDialog( _("Quit"), - _("Are you sure you " - "want to quit?")); + exitConfirm = new ConfirmDialog(_("Quit"), + _("Are you sure you " + "want to quit?")); exitConfirm->addActionListener(&exitListener); exitConfirm->requestMoveToTop(); } @@ -774,7 +774,7 @@ void Game::handleInput() catch (gcn::Exception e) { const char* err = e.getMessage().c_str(); - logger->log(_("Warning: guichan input exception: %s"), err); + logger->log("Warning: guichan input exception: %s", err); } } } // End while diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 50182de1..fd7df18d 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -153,7 +153,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "register" && canSubmit()) { const std::string user = mUserField->getText(); - logger->log(_("RegisterDialog::register Username is %s"), user.c_str()); + logger->log("RegisterDialog::register Username is %s", user.c_str()); std::string errorMsg; int error = 0; diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 48bf63e7..bf5682e6 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -90,9 +90,9 @@ ModeListModel::ModeListModel() /* Check which modes are available */ if (modes == (SDL_Rect **)0) { - logger->log(_("No modes available")); + logger->log("No modes available"); } else if (modes == (SDL_Rect **)-1) { - logger->log(_("All resolutions available")); + logger->log("All resolutions available"); } else { //logger->log("Available Modes"); for (int i = 0; modes[i]; ++i) { diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 6c0414f3..42ac4d86 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -269,7 +269,7 @@ static void initSkillinfo(void) if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) { - logger->log(_("Error loading skills file: %s"), SKILLS_FILE); + logger->log("Error loading skills file: %s", SKILLS_FILE); skill_db.resize(2, emptySkillInfo); skill_db[1].name = "Basic"; skill_db[1].modifiable = true; diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 5a6f3f28..a25d57d4 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -76,7 +76,7 @@ std::vector<std::string> loadTextFile(const std::string &fileName) std::ifstream fin(fileName.c_str()); if (!fin) { - logger->log(_("Couldn't load text file: %s"), fileName.c_str()); + logger->log("Couldn't load text file: %s", fileName.c_str()); return lines; } @@ -194,7 +194,7 @@ void UpdaterWindow::loadNews() { if (!mMemoryBuffer) { - logger->log(_("Couldn't load news")); + logger->log("Couldn't load news"); return; } @@ -411,7 +411,7 @@ void UpdaterWindow::download() if (!mThread) { - logger->log(_("Unable to create mThread")); + logger->log("Unable to create mThread"); mDownloadStatus = UPDATE_ERROR; } } @@ -505,7 +505,7 @@ void UpdaterWindow::logic() } else { - logger->log(_("%s already here"), mCurrentFile.c_str()); + logger->log("%s already here", mCurrentFile.c_str()); } mLineIndex++; } diff --git a/src/main.cpp b/src/main.cpp index 80cff8d1..4f66e9da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,14 +208,14 @@ void setUpdatesDir() } else { - logger->log(_("Error: Invalid update host: %s"), updateHost.c_str()); + logger->log("Error: Invalid update host: %s", updateHost.c_str()); errorMessage = _("Invalid update host: ") + updateHost; state = ERROR_STATE; } } else { - logger->log(_("Warning: no protocol was specified for the update host")); + logger->log("Warning: no protocol was specified for the update host"); updates << "updates/" << updateHost << "/" << loginData.port; updatesDir = updates.str(); } @@ -240,14 +240,14 @@ void setUpdatesDir() if (!CreateDirectory(newDir.c_str(), 0) && GetLastError() != ERROR_ALREADY_EXISTS) { - logger->log(_("Error: %s can't be made, but doesn't exist!"), - newDir.c_str()); + logger->log("Error: %s can't be made, but doesn't exist!", + newDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; } #else - logger->log(_("Error: %s/%s can't be made, but doesn't exist!"), - homeDir.c_str(), updatesDir.c_str()); + logger->log("Error: %s/%s can't be made, but doesn't exist!", + homeDir.c_str(), updatesDir.c_str()); errorMessage = _("Error creating updates directory!"); state = ERROR_STATE; #endif @@ -286,13 +286,13 @@ void init_engine(const Options &options) logger->setLogFile(homeDir + std::string("/aethyra.log")); #ifdef PACKAGE_VERSION - logger->log(_("Starting Aethyra Version %s"), PACKAGE_VERSION); + logger->log("Starting Aethyra Version %s", PACKAGE_VERSION); #else - logger->log(_("Starting Aethyra - Version not defined")); + logger->log("Starting Aethyra - Version not defined")); #endif // Initialize SDL - logger->log(_("Initializing 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; @@ -337,7 +337,7 @@ void init_engine(const Options &options) #endif // Fill configuration with defaults - logger->log(_("Initializing configuration...")); + logger->log("Initializing configuration..."); config.setValue("host", "www.aethyra.org"); config.setValue("port", 21001); config.setValue("hwaccel", 0); @@ -451,7 +451,7 @@ void init_engine(const Options &options) catch (const char *err) { state = ERROR_STATE; errorMessage = err; - logger->log(_("Warning: %s"), err); + logger->log("Warning: %s", err); } // Initialize keyboard @@ -497,7 +497,8 @@ void printHelp() << _("Options: ") << std::endl << _(" -C --configfile : Configuration file to use") << std::endl << _(" -d --data : Directory to load game data from") << std::endl - << _(" -D --default : Bypass the login process with default settings") << std::endl + << _(" -D --default : Bypass the login process with default settings") + << std::endl << _(" -h --help : Display this help") << std::endl << _(" -H --updatehost : Use this update host") << std::endl << _(" -p --playername : Login with this player") << std::endl @@ -610,8 +611,8 @@ struct ErrorListener : public gcn::ActionListener // TODO Find some nice place for these functions void accountLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to account server...")); - logger->log(_("Username is %s"), loginData->username.c_str()); + logger->log("Trying to connect to account server..."); + logger->log("Username is %s", loginData->username.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&loginHandler); loginHandler.setLoginData(loginData); @@ -665,7 +666,7 @@ void positionDialog(Window *dialog, int screenWidth, int screenHeight) void charLogin(Network *network, LoginData *loginData) { - logger->log(_("Trying to connect to char server...")); + logger->log("Trying to connect to char server..."); network->connect(loginData->hostname, loginData->port); network->registerHandler(&charServerHandler); charServerHandler.setCharInfo(&charInfo); @@ -677,7 +678,8 @@ void charLogin(Network *network, LoginData *loginData) outMsg.writeInt32(loginData->account_ID); outMsg.writeInt32(loginData->session_ID1); outMsg.writeInt32(loginData->session_ID2); - // [Fate] The next word is unused by the old char server, so we squeeze in tmw client version information + // [Fate] The next word is unused by the old char server, so we squeeze in + // tmw client version information outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); outMsg.writeInt8(loginData->sex); @@ -687,14 +689,14 @@ void charLogin(Network *network, LoginData *loginData) void mapLogin(Network *network, LoginData *loginData) { - logger->log(_("Memorizing selected character %s"), + logger->log("Memorizing selected character %s", player_node->getName().c_str()); config.setValue("lastCharacter", player_node->getName()); MessageOut outMsg(network); - logger->log(_("Trying to connect to map server...")); - logger->log(_("Map: %s"), map_path.c_str()); + logger->log("Trying to connect to map server..."); + logger->log("Map: %s", map_path.c_str()); network->connect(loginData->hostname, loginData->port); network->registerHandler(&mapLoginHandler); @@ -824,7 +826,7 @@ int main(int argc, char *argv[]) login_wallpaper = ResourceManager::getInstance()-> getImage(wallpaperName); if (!login_wallpaper) - logger->log(_("Couldn't load %s as wallpaper"), wallpaperName.c_str()); + logger->log("Couldn't load %s as wallpaper", wallpaperName.c_str()); while (state != EXIT_STATE) { diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 21c37ea3..9ca3b48a 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -192,9 +192,9 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mMaxWeight / 2) { weightNotice = new OkDialog(_("Message"), - _("You are carrying more then half " - "your weight. You are unable to " - "regain health.")); + _("You are carrying more then " + "half your weight. You are " + "unable to regain health.")); weightNotice->addActionListener( &weightListener); } @@ -392,7 +392,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) BY_SERVER); break; default: - logger->log(_("0x013b: Unhandled message %i"), type); + logger->log("0x013b: Unhandled message %i", type); break; } } diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 4ff8944c..b53798bb 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -25,7 +25,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" #define HAIR_COLOR_FILE "colors.xml" @@ -51,7 +50,7 @@ void ColorDB::load() if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("Trying TMW's color file, %s."), TMW_COLOR_FILE); + logger->log("Trying TMW's color file, %s.", TMW_COLOR_FILE); TMWHair = true; @@ -61,7 +60,7 @@ void ColorDB::load() root = doc->rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log(_("ColorDB: Failed")); + logger->log("ColorDB: Failed"); mColors[0] = mFail; mLoaded = true; @@ -78,7 +77,7 @@ void ColorDB::load() if (mColors.find(id) != mColors.end()) { - logger->log(_("ColorDB: Redefinition of dye ID %d"), id); + logger->log("ColorDB: Redefinition of dye ID %d", id); } TMWHair ? mColors[id] = XML::getProperty(node, "value", "#FFFFFF") : @@ -93,7 +92,7 @@ void ColorDB::load() void ColorDB::unload() { - logger->log(_("Unloading color database...")); + logger->log("Unloading color database..."); mColors.clear(); mLoaded = false; @@ -108,7 +107,7 @@ std::string& ColorDB::get(int id) if (i == mColors.end()) { - logger->log(_("ColorDB: Error, unknown dye ID# %d"), id); + logger->log("ColorDB: Error, unknown dye ID# %d", id); return mFail; } else diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index 5a014c95..23a7833c 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -23,7 +23,6 @@ #include "../log.h" -#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -47,14 +46,14 @@ void EmoteDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing emote database...")); + logger->log("Initializing emote database..."); XML::Document doc("emotes.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes")) { - logger->log(_("Emote Database: Error while loading emotes.xml!")); + logger->log("Emote Database: Error while loading emotes.xml!"); return; } @@ -67,7 +66,7 @@ void EmoteDB::load() int id = XML::getProperty(emoteNode, "id", -1); if (id == -1) { - logger->log(_("Emote Database: Emote with missing ID in emotes.xml!")); + logger->log("Emote Database: Emote with missing ID in emotes.xml!"); continue; } @@ -126,7 +125,7 @@ const EmoteInfo& EmoteDB::get(int id) if (i == mEmoteInfos.end()) { - logger->log(_("EmoteDB: Warning, unknown emote ID %d requested"), id); + logger->log("EmoteDB: Warning, unknown emote ID %d requested", id); return mUnknown; } else diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 5577b5e1..ceaf0395 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -50,7 +50,7 @@ void ItemDB::load() if (mLoaded) return; - logger->log(_("Initializing item database...")); + logger->log("Initializing item database..."); mUnknown = new ItemInfo(); mUnknown->setName(_("Unknown item")); @@ -63,7 +63,7 @@ void ItemDB::load() if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) { - logger->error(_("ItemDB: Error while loading items.xml!")); + logger->error("ItemDB: Error while loading items.xml!"); } for_each_xml_child_node(node, rootNode) @@ -75,12 +75,12 @@ void ItemDB::load() if (id == 0) { - logger->log(_("ItemDB: Invalid or missing item ID in items.xml!")); + logger->log("ItemDB: Invalid or missing item ID in items.xml!"); continue; } else if (mItemInfos.find(id) != mItemInfos.end()) { - logger->log(_("ItemDB: Redefinition of item ID %d"), id); + logger->log("ItemDB: Redefinition of item ID %d", id); } std::string type = XML::getProperty(node, "type", "other"); @@ -136,7 +136,7 @@ void ItemDB::load() } else { - logger->log(_("ItemDB: Duplicate name of item found item %d"), + logger->log("ItemDB: Duplicate name of item found item %d", id); } } @@ -162,7 +162,7 @@ void ItemDB::load() void ItemDB::unload() { - logger->log(_("Unloading item database...")); + logger->log("Unloading item database..."); delete mUnknown; mUnknown = NULL; @@ -180,7 +180,7 @@ const ItemInfo& ItemDB::get(int id) if (i == mItemInfos.end()) { - logger->log(_("ItemDB: Error, unknown item ID# %d"), id); + logger->log("ItemDB: Error, unknown item ID# %d", id); return *mUnknown; } else @@ -236,7 +236,7 @@ void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) } else { - logger->log(_("ItemDB: Ignoring unknown sound event '%s'"), + logger->log("ItemDB: Ignoring unknown sound event '%s'", event.c_str()); } } diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 13f3a7ee..b1965989 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -44,14 +44,14 @@ void MonsterDB::load() mUnknown.addSprite("error.xml"); mUnknown.setName(_("unnamed")); - logger->log(_("Initializing monster database...")); + logger->log("Initializing monster database..."); XML::Document doc(_("monsters.xml")); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { - logger->error(_("Monster Database: Error while loading monster.xml!")); + logger->error("Monster Database: Error while loading monster.xml!"); } //iterate <monster>s @@ -64,7 +64,7 @@ void MonsterDB::load() MonsterInfo *currentInfo = new MonsterInfo(); - currentInfo->setName (XML::getProperty(monsterNode, "name", "unnamed")); + currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed"))); std::string targetCursor; targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium"); @@ -82,7 +82,8 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one"), + logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -" + "using medium sized one", targetCursor.c_str(), currentInfo->getName().c_str()); currentInfo->setTargetCursorSize(Being::TC_MEDIUM); } @@ -92,7 +93,8 @@ void MonsterDB::load() { if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { - currentInfo->addSprite((const char*) spriteNode->xmlChildrenNode->content); + currentInfo->addSprite( + (const char*) spriteNode->xmlChildrenNode->content); } if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) @@ -119,14 +121,17 @@ void MonsterDB::load() } else { - logger->log(_("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s"), - filename, event.c_str(), currentInfo->getName().c_str()); + logger->log("MonsterDB: Warning, sound effect %s for " + "unknown event %s of monster %s", + filename, event.c_str(), + currentInfo->getName().c_str()); } } if (xmlStrEqual(spriteNode->name, BAD_CAST "attack")) { - std::string event = XML::getProperty(spriteNode, "particle-effect", ""); + std::string event = XML::getProperty( + spriteNode, "particle-effect", ""); currentInfo->addAttackParticleEffect(event); } @@ -157,7 +162,7 @@ const MonsterInfo &MonsterDB::get(int id) if (i == mMonsterInfos.end()) { - logger->log(_("MonsterDB: Warning, unknown monster ID %d requested"), id); + logger->log("MonsterDB: Warning, unknown monster ID %d requested", id); return mUnknown; } else diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 177d3116..3e9decf1 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -44,7 +44,7 @@ void NPCDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log(_("Initializing NPC database...")); + logger->log("Initializing NPC database..."); XML::Document doc("npcs.xml"); xmlNodePtr rootNode = doc.rootNode(); @@ -63,7 +63,7 @@ void NPCDB::load() int id = XML::getProperty(npcNode, "id", 0); if (id == 0) { - logger->log(_("NPC Database: NPC with missing ID in npcs.xml!")); + logger->log("NPC Database: NPC with missing ID in npcs.xml!"); continue; } @@ -121,7 +121,7 @@ const NPCInfo& NPCDB::get(int id) if (i == mNPCInfos.end()) { - logger->log(_("NPCDB: Warning, unknown NPC ID %d requested"), id); + logger->log("NPCDB: Warning, unknown NPC ID %d requested", id); return mUnknown; } else |