From 7eabde6aeeea1a8fa6597c4865422961a944244b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 4 Jun 2012 23:24:31 +0300 Subject: Use gettext for more basic user interface strings --- src/main.cpp | 101 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 50 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b133722c3..10c83824a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -778,46 +778,46 @@ int main(int argc, char *argv[]) // List all allowed options core::map allowed_options; allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG, - "Show allowed options")); + _("Show allowed options"))); allowed_options.insert("config", ValueSpec(VALUETYPE_STRING, - "Load configuration from specified file")); + _("Load configuration from specified file"))); allowed_options.insert("port", ValueSpec(VALUETYPE_STRING, - "Set network port (UDP)")); + _("Set network port (UDP)"))); allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG, - "Disable unit tests")); + _("Disable unit tests"))); allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG, - "Enable unit tests")); + _("Enable unit tests"))); allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING, - "Same as --world (deprecated)")); + _("Same as --world (deprecated)"))); allowed_options.insert("world", ValueSpec(VALUETYPE_STRING, - "Set world path (implies local game) ('list' lists all)")); + _("Set world path (implies local game) ('list' lists all)"))); allowed_options.insert("worldname", ValueSpec(VALUETYPE_STRING, - "Set world by name (implies local game)")); + _("Set world by name (implies local game)"))); allowed_options.insert("info", ValueSpec(VALUETYPE_FLAG, - "Print more information to console")); + _("Print more information to console"))); allowed_options.insert("verbose", ValueSpec(VALUETYPE_FLAG, - "Print even more information to console")); + _("Print even more information to console"))); allowed_options.insert("trace", ValueSpec(VALUETYPE_FLAG, - "Print enormous amounts of information to log and console")); + _("Print enormous amounts of information to log and console"))); allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING, - "Set logfile path ('' = no logging)")); + _("Set logfile path ('' = no logging)"))); allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING, - "Set gameid (\"--gameid list\" prints available ones)")); + _("Set gameid (\"--gameid list\" prints available ones)"))); #ifndef SERVER allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG, - "Run speed tests")); + _("Run speed tests"))); allowed_options.insert("address", ValueSpec(VALUETYPE_STRING, - "Address to connect to. ('' = local game)")); + _("Address to connect to. ('' = local game)"))); allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG, - "Enable random user input, for testing")); + _("Enable random user input, for testing"))); allowed_options.insert("server", ValueSpec(VALUETYPE_FLAG, - "Run dedicated server")); + _("Run dedicated server"))); allowed_options.insert("name", ValueSpec(VALUETYPE_STRING, - "Set player name")); + _("Set player name"))); allowed_options.insert("password", ValueSpec(VALUETYPE_STRING, - "Set password")); + _("Set password"))); allowed_options.insert("go", ValueSpec(VALUETYPE_FLAG, - "Disable main menu")); + _("Disable main menu"))); #endif Settings cmd_args; @@ -826,7 +826,7 @@ int main(int argc, char *argv[]) if(ret == false || cmd_args.getFlag("help") || cmd_args.exists("nonopt1")) { - dstream<<"Allowed options:"<::Iterator i = allowed_options.getIterator(); i.atEnd() == false; i++) @@ -836,7 +836,7 @@ int main(int argc, char *argv[]) if(i.getNode()->getValue().type == VALUETYPE_FLAG) {} else - os1<<" "; + os1<<_(" "); dstream<getValue().help != NULL) @@ -853,7 +853,7 @@ int main(int argc, char *argv[]) // If trace is enabled, enable logging of certain things if(cmd_args.getFlag("trace")){ - dstream<<"Enabling trace level debug output"< worldspecs = getAvailableWorlds(); print_worldspecs(worldspecs, dstream); return 0; @@ -920,7 +920,7 @@ int main(int argc, char *argv[]) // Print startup message infostream< worldmt.size() && commanded_world.substr(commanded_world.size()-worldmt.size()) == worldmt){ - dstream<<"Supplied world.mt file - stripping it off."< 1){ - dstream<<"Multiple worlds are available."<" - <<" or --world "<" + " or --world ")<run() && kill == false) { // Set the window caption - device->setWindowCaption(L"Minetest [Main Menu]"); + device->setWindowCaption((std::wstring(L"Minetest [")+wgettext("Main Menu")+L"]").c_str()); // This is used for catching disconnects try @@ -1461,7 +1461,7 @@ int main(int argc, char *argv[]) // If a world was commanded, append and select it if(commanded_world != ""){ std::string gameid = getWorldGameId(commanded_world, true); - std::string name = "[--world parameter]"; + std::string name = _("[--world parameter]"); if(gameid == ""){ gameid = g_settings->get("default_game"); name += " [new]"; @@ -1598,7 +1598,7 @@ int main(int argc, char *argv[]) + wide_to_narrow(menudata.create_world_name); // Create world if it doesn't exist if(!initializeWorld(path, menudata.create_world_gameid)){ - error_message = L"Failed to initialize world"; + error_message = wgettext("Failed to initialize world"); errorstream<