← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/string-fixes into lp:widelands.

Commit message:
Various string fixes:
- Added localization marker for production program names
- Fixed stone -> granite in Atlantean campaign
- Fixed grammar in Empire campaign
- Correct use of Unicode ellipsis
- Some small code style fixes

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1421942 in widelands: "Unified term for "Black" and "Wasteland""
  https://bugs.launchpad.net/widelands/+bug/1421942
  Bug #1487887 in widelands: "Translation missing in editor and in replay tooltip"
  https://bugs.launchpad.net/widelands/+bug/1487887
  Bug #1530240 in widelands: "wrong text in the tribal encyclopedia for the battle ax"
  https://bugs.launchpad.net/widelands/+bug/1530240
  Bug #1530398 in widelands: "Wrong text above marble mine"
  https://bugs.launchpad.net/widelands/+bug/1530398

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/286547

Various string fixes:
- Added localization marker for production program names
- Fixed stone -> granite in Atlantean campaign
- Fixed grammar in Empire campaign
- Correct use of Unicode ellipsis
- Some small code style fixes
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/string-fixes into lp:widelands.
=== modified file 'data/campaigns/atl01.wmf/scripting/texts.lua'
--- data/campaigns/atl01.wmf/scripting/texts.lua	2016-01-28 05:24:34 +0000
+++ data/campaigns/atl01.wmf/scripting/texts.lua	2016-02-18 18:33:06 +0000
@@ -85,7 +85,7 @@
    title = _"Build industry and mines",
    number = 5,
    body = objective_text(_"Industry and Mines",
-      _[[Iron ore, gold ore and coal are mined in the respective mines. The crystal mine will dig for quartz and diamonds – all of them are precious materials and very rarely found. It will produce a lot of stone while searching for them.]] .. paragraphdivider() ..
+      _[[Iron ore, gold ore and coal are mined in the respective mines. The crystal mine will dig for quartz and diamonds – all of them are precious materials and very rarely found. It will produce a lot of granite while searching for them.]] .. paragraphdivider() ..
       listitem_bullet(_[[The ores have to be smelted at a smelting works before they can be used. The refined materials are then used in the weapon smithy, the armor smithy and the toolsmithy.]]) .. paragraphdivider() ..
       listitem_bullet(_[[Build a mine of each type. Make sure to send geologists to the mountain first.]]) ..
       listitem_bullet(_[[Build a smelting works]]) ..
@@ -154,9 +154,9 @@
    {
       title = _"Uproar and Confusion",
       body = rt(
-         h1(_"Emerging Chaos...") ..
+         h1(_"Emerging Chaos…") ..
          -- TRANSLATORS: Foreword
-         p(_([[Guilt-ridden, the king committed suicide. Without a monarch, the people turned to the clerics, but they had no substantial help to offer. Most accepted their fate while others tried to change the god’s mind by offering animals in his temple. But to no avail...]])) ..
+         p(_([[Guilt-ridden, the king committed suicide. Without a monarch, the people turned to the clerics, but they had no substantial help to offer. Most accepted their fate while others tried to change the god’s mind by offering animals in his temple. But to no avail…]])) ..
          -- TRANSLATORS: Foreword
           p(_([[Jundlina, the late king’s daughter and the highest priestess of the god was the most determined cleric. As countless offerings didn’t change the situation, she convinced herself that to soothe the god, an offer of great personal value was needed. So she offered him her most beloved: her husband, the father of her only child.]])) ..
           -- TRANSLATORS: Foreword
@@ -443,7 +443,7 @@
       title = _"Jundlina is Relieved",
       body = jundlina(_"Jundlina",
          -- TRANSLATORS: Jundlina
-         _([[Praise Satul! Ostur, the young ship builder did it. We have three ships – never have I seen sturdier ones – with enough room to carry all of us and some wares too. And this rescue came just in time: Lutas is about to swallow the rest of this island, the water rises faster by the hour. But we can make our escape now and start over in some country farther away...]])
+         _([[Praise Satul! Ostur, the young ship builder did it. We have three ships – never have I seen sturdier ones – with enough room to carry all of us and some wares too. And this rescue came just in time: Lutas is about to swallow the rest of this island, the water rises faster by the hour. But we can make our escape now and start over in some country farther away…]])
          .. paragraphdivider() ..
          -- TRANSLATORS: Jundlina
          _([[I expect a long journey, but we will find the land of Satul in the end. This is what I promised my people. And myself.]]))

=== modified file 'data/campaigns/emp01.wmf/scripting/texts.lua'
--- data/campaigns/emp01.wmf/scripting/texts.lua	2016-01-28 05:24:34 +0000
+++ data/campaigns/emp01.wmf/scripting/texts.lua	2016-02-18 18:33:06 +0000
@@ -168,7 +168,7 @@
    title=_"Young Amalea",
    body= amalea(_"Amalea recommends…",
       -- TRANSLATORS: Amalea
-      _([[I got the message that our first lumberjack has started his work today. Perhaps it would be a good idea to wait until he cleans enough space for constructing two more lumberjack’s houses, so that we can harvest the logs faster.]])
+      _([[I got the message that our first lumberjack has started his work today. Perhaps it would be a good idea to wait until he has cleared enough space for constructing two more lumberjack’s houses, so that we can harvest the logs faster.]])
       .. paragraphdivider() ..
       -- TRANSLATORS: Amalea
       _([[But unfortunately the logs are useless for repairing our ship – we need to turn them into planks, which are needed by every ship and every bigger building too. So we should build a sawmill – as soon as we have enough space for this.]]))

=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2016-02-10 16:37:45 +0000
+++ src/editor/editorinteractive.cc	2016-02-18 18:33:06 +0000
@@ -629,7 +629,7 @@
 			Widelands::Map & map = *new Widelands::Map;
 			egbase.set_map(&map);
 			if (filename.empty()) {
-				loader_ui.step(_("Creating empty map..."));
+				loader_ui.step(_("Creating empty map…"));
 				map.create_empty_map(
 				   egbase.world(),
 				   64,
@@ -644,7 +644,7 @@
 				egbase.load_graphics(loader_ui);
 				loader_ui.step(std::string());
 			} else {
-				loader_ui.stepf(_("Loading map \"%s\"..."), filename.c_str());
+				loader_ui.stepf(_("Loading map “%s”…"), filename.c_str());
 				eia.load(filename);
 			}
 		}

=== modified file 'src/editor/ui_menus/editor_main_menu_new_map.cc'
--- src/editor/ui_menus/editor_main_menu_new_map.cc	2016-02-07 09:16:18 +0000
+++ src/editor/ui_menus/editor_main_menu_new_map.cc	2016-02-18 18:33:06 +0000
@@ -117,7 +117,7 @@
 	Widelands::Map              & map    = egbase.map();
 	UI::ProgressWindow loader_ui;
 
-	loader_ui.step(_("Creating empty map..."));
+	loader_ui.step(_("Creating empty map…"));
 
 	egbase.cleanup_for_load();
 

=== modified file 'src/editor/ui_menus/editor_main_menu_random_map.cc'
--- src/editor/ui_menus/editor_main_menu_random_map.cc	2016-02-07 09:16:18 +0000
+++ src/editor/ui_menus/editor_main_menu_random_map.cc	2016-02-18 18:33:06 +0000
@@ -449,7 +449,7 @@
 		_("No Name"),
 		g_options.pull_section("global").get_string("realname", pgettext("map_name", "Unknown")),
 		sstrm.str().c_str());
-	loader_ui.step(_("Generating random map..."));
+	loader_ui.step(_("Generating random map…"));
 	gen.create_random_map();
 
 	egbase.postload     ();

=== modified file 'src/logic/game.cc'
--- src/logic/game.cc	2016-02-07 07:16:24 +0000
+++ src/logic/game.cc	2016-02-18 18:33:06 +0000
@@ -203,14 +203,14 @@
 }
 
 
-bool Game::run_splayer_scenario_direct(char const * const mapname, const std::string& script_to_run) {
+bool Game::run_splayer_scenario_direct(const std::string& mapname, const std::string& script_to_run) {
 	assert(!get_map());
 
 	set_map(new Map);
 
 	std::unique_ptr<MapLoader> maploader(map().get_correct_loader(mapname));
 	if (!maploader)
-		throw wexception("could not load \"%s\"", mapname);
+		throw wexception("could not load \"%s\"", mapname.c_str());
 	UI::ProgressWindow loader_ui;
 
 	loader_ui.step (_("Preloading map"));
@@ -241,7 +241,7 @@
 		(new InteractivePlayer
 		 	(*this, g_options.pull_section("global"), 1, false));
 
-	loader_ui.step(_("Loading map"));
+	loader_ui.step(_("Loading map…"));
 	maploader->load_map_complete(*this, Widelands::MapLoader::LoadType::kScenario);
 	maploader.reset();
 
@@ -321,7 +321,7 @@
 			->add_further_starting_position(shared_num.at(n), shared.at(n).initialization_index);
 	}
 
-	loader_ui->step(_("Loading map"));
+	loader_ui->step(_("Loading map…"));
 	maploader->load_map_complete(*this,
 										  settings.scenario ?
 											  Widelands::MapLoader::LoadType::kScenario :
@@ -363,14 +363,14 @@
 		m_win_condition_displayname = gpdp.get_win_condition();
 		std::string background(gpdp.get_background());
 		loader_ui->set_background(background);
-		loader_ui->step(_("Loading..."));
+		loader_ui->step(_("Loading…"));
 		gl.load_game(settings.multiplayer);
 	} catch (...) {
 		throw;
 	}
 }
 
-bool Game::run_load_game(std::string filename, const std::string& script_to_run) {
+bool Game::run_load_game(const std::string& filename, const std::string& script_to_run) {
 	UI::ProgressWindow loader_ui;
 	std::vector<std::string> tipstext;
 	tipstext.push_back("general_game");
@@ -396,7 +396,7 @@
 			(new InteractivePlayer
 			 	(*this, g_options.pull_section("global"), player_nr, false));
 
-		loader_ui.step(_("Loading..."));
+		loader_ui.step(_("Loading…"));
 		gl.load_game();
 	}
 

=== modified file 'src/logic/game.h'
--- src/logic/game.h	2016-02-08 06:12:18 +0000
+++ src/logic/game.h	2016-02-18 18:33:06 +0000
@@ -123,12 +123,12 @@
 	// Run a single player scenario directly via --scenario on the cmdline. Will
 	// run the 'script_to_run' after any init scripts of the map.
 	// Returns the result of run().
-	bool run_splayer_scenario_direct(char const * mapname, const std::string& script_to_run);
+	bool run_splayer_scenario_direct(const std::string& mapname, const std::string& script_to_run);
 
 	// Run a single player loaded game directly via --loadgame on the cmdline. Will
 	// run the 'script_to_run' directly after the game was loaded.
 	// Returns the result of run().
-	bool run_load_game (std::string filename, const std::string& script_to_run);
+	bool run_load_game (const std::string& filename, const std::string& script_to_run);
 
 	void postload() override;
 

=== modified file 'src/logic/map_objects/tribes/productionsite.cc'
--- src/logic/map_objects/tribes/productionsite.cc	2016-02-15 22:31:59 +0000
+++ src/logic/map_objects/tribes/productionsite.cc	2016-02-18 18:33:06 +0000
@@ -179,7 +179,7 @@
 				programs_[program_name] =
 						std::unique_ptr<ProductionProgram>(
 							new ProductionProgram(program_name,
-														 program_table->get_string("descname"),
+														 _(program_table->get_string("descname")),
 														 program_table->get_table("actions"),
 														 egbase,
 														 this));

=== modified file 'src/logic/save_handler.cc'
--- src/logic/save_handler.cc	2016-02-15 15:21:07 +0000
+++ src/logic/save_handler.cc	2016-02-18 18:33:06 +0000
@@ -103,7 +103,7 @@
 
 	// TODO(unknown): defer saving to next tick so that this message is shown
 	// before the actual save, or put the saving logic in another thread
-	game.get_ibase()->log_message(_("Saving game..."));
+	game.get_ibase()->log_message(_("Saving game…"));
 
 	// save the game
 	const std::string complete_filename = create_file_name(get_base_dir(), filename);
@@ -159,18 +159,18 @@
 /*
  * Calculate the name of the save file
  */
-std::string SaveHandler::create_file_name
-	(std::string dir, std::string filename)
+std::string SaveHandler::create_file_name(const std::string& dir, const std::string& filename) const
 {
-	// ok, first check if the extension matches (ignoring case)
-	if (!boost::iends_with(filename, WLGF_SUFFIX))
-		filename += WLGF_SUFFIX;
-
-	// Now append directory name
+	// Append directory name
 	std::string complete_filename = dir;
 	complete_filename += "/";
 	complete_filename += filename;
 
+	// Now check if the extension matches (ignoring case)
+	if (!boost::iends_with(filename, WLGF_SUFFIX)) {
+		complete_filename += WLGF_SUFFIX;
+	}
+
 	return complete_filename;
 }
 

=== modified file 'src/logic/save_handler.h'
--- src/logic/save_handler.h	2016-02-15 15:21:07 +0000
+++ src/logic/save_handler.h	2016-02-18 18:33:06 +0000
@@ -35,7 +35,7 @@
 	SaveHandler() : m_last_saved_realtime(0), m_initialized(false), m_allow_saving(true),
 		m_save_requested(false), m_save_filename(""), autosave_filename_("wl_autosave") {}
 	void think(Widelands::Game &);
-	std::string create_file_name(std::string dir, std::string filename);
+	std::string create_file_name(const std::string& dir, const std::string& filename) const;
 	bool save_game
 		(Widelands::Game   &,
 		 const std::string & filename,
@@ -43,11 +43,11 @@
 
 	static std::string get_base_dir() {return "save";}
 	const std::string get_cur_filename() {return m_current_filename;}
-	void set_current_filename(std::string filename) {m_current_filename = filename;}
-	void set_autosave_filename(std::string filename) {autosave_filename_ = filename;}
+	void set_current_filename(const std::string& filename) {m_current_filename = filename;}
+	void set_autosave_filename(const std::string& filename) {autosave_filename_ = filename;}
 	void set_allow_saving(bool t) {m_allow_saving = t;}
 	bool get_allow_saving() {return m_allow_saving;}
-	void request_save(std::string filename = "")
+	void request_save(const std::string& filename = "")
 	{
 		m_save_requested = true;
 		m_save_filename = filename;

=== modified file 'src/ui_basic/progresswindow.cc'
--- src/ui_basic/progresswindow.cc	2016-02-06 19:59:13 +0000
+++ src/ui_basic/progresswindow.cc	2016-02-18 18:33:06 +0000
@@ -32,6 +32,8 @@
 #include "graphic/text_layout.h"
 #include "io/filesystem/layered_filesystem.h"
 
+namespace {
+
 #define PROGRESS_FONT_COLOR_FG        RGBColor(128, 128, 255)
 #define PROGRESS_FONT_COLOR_BG        RGBColor(64, 64, 0)
 #define PROGRESS_STATUS_RECT_PADDING  2
@@ -39,11 +41,13 @@
 #define PROGRESS_STATUS_BORDER_Y      2
 #define PROGRESS_LABEL_POSITION_Y     90 /* in percents, from top */
 
+} // namespace
+
 namespace UI {
 
 ProgressWindow::ProgressWindow(const std::string& background) {
 	set_background(background);
-	step(_("Preparing..."));
+	step(_("Loading…"));
 }
 
 ProgressWindow::~ProgressWindow() {

=== modified file 'src/ui_fsmenu/intro.cc'
--- src/ui_fsmenu/intro.cc	2016-02-08 20:53:35 +0000
+++ src/ui_fsmenu/intro.cc	2016-02-18 18:33:06 +0000
@@ -29,7 +29,7 @@
 message_
 	(this,
 	 get_w() / 2, get_h() * 19 / 20,
-	 _("Press any key or click to continue ..."), UI::Align::kHCenter)
+	 _("Press any key or click to continue…"), UI::Align::kHCenter)
 {
 	message_.set_fontsize(fs_small() * 6 / 5);
 	message_.set_color(RGBColor(192, 192, 128));

=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc	2016-02-15 22:31:59 +0000
+++ src/wlapplication.cc	2016-02-18 18:33:06 +0000
@@ -418,7 +418,7 @@
 	} else if (game_type_ == LOADGAME) {
 		Widelands::Game game;
 		try {
-			game.run_load_game(filename_.c_str(), script_to_run_);
+			game.run_load_game(filename_, script_to_run_);
 		} catch (const Widelands::GameDataError & e) {
 			log("Game not loaded: Game data error: %s\n", e.what());
 		} catch (const std::exception & e) {
@@ -1374,7 +1374,7 @@
 		tipstext.push_back("general_game");
 		GameTips tips (loader_ui, tipstext);
 
-		loader_ui.step(_("Loading..."));
+		loader_ui.step(_("Loading…"));
 
 		game.set_ibase
 			(new InteractiveSpectator(game, g_options.pull_section("global")));


Follow ups