← 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.

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

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

Various string fixes.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/string-fixes into lp:widelands.
=== modified file 'campaigns/emp02.wmf/scripting/texts.lua'
--- campaigns/emp02.wmf/scripting/texts.lua	2015-11-17 13:49:59 +0000
+++ campaigns/emp02.wmf/scripting/texts.lua	2015-11-27 17:43:13 +0000
@@ -154,7 +154,7 @@
    posy=1,
    body= lutius(_"Diary of Lutius",
       -- TRANSLATORS: Lutius - Diary
-      _[[Great! Today the building of the quarry was completed. Now we will get enough stones to construct larger buildings.]]),
+      _[[Great! Today the building of the quarry was completed. Now we will get enough granite and marble to construct larger buildings.]]),
 }
 
 saledus_1 = {

=== modified file 'campaigns/tutorial01_basic_control.wmf/scripting/texts.lua'
--- campaigns/tutorial01_basic_control.wmf/scripting/texts.lua	2015-11-17 13:49:59 +0000
+++ campaigns/tutorial01_basic_control.wmf/scripting/texts.lua	2015-11-27 17:43:13 +0000
@@ -41,7 +41,7 @@
       h1(_"Let’s dive right in!") ..
       p(_[[There are three different tribes in Widelands: the Barbarians, the Empire and the Atlanteans. All tribes have a different economy, strength and weaknesses, but the general gameplay is the same for all. We will play the Barbarians for now.]]) ..
       p(_[[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters is a warehouse that stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the wares in the headquarters will not last forever, so you must make sure to replace them. The most important wares in the early game are the basic construction wares: logs and granite. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]]) ..
-      p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this, either by clicking on the ‘Show Building Spaces’ button at the bottom of the screen, which is the fourth one from the left. Or you can use the SPACE key to toggle it.]]) ..
+      p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this, either by clicking on the ‘Show Building Spaces’ button at the bottom of the screen, which is the fourth one from the left. Or you can use the Space key to toggle it.]]) ..
       paragraphdivider() ..
       listitem_bullet(_[[Left-click the ‘OK’ button to close this box and then try it.]])
    ),
@@ -51,7 +51,7 @@
       h1(_"Show Building Spaces") ..
       p(_[[It is easier to understand what type of buildings can be built on which field when the symbols for the building spaces are enabled.]]) ..
       paragraphdivider() ..
-      listitem_bullet(_[[Do so now, either by pressing SPACE or by clicking the fourth button from the left at the very bottom of the screen. Right-click on this window and then give it a try.]])
+      listitem_bullet(_[[Do so now, either by pressing Space or by clicking the fourth button from the left at the very bottom of the screen. Right-click on this window and then give it a try.]])
    )
 }
 
@@ -135,7 +135,7 @@
    position = "topright",
    body = rt(
       p(_[[Well done! Let’s wait till the hut is finished.]]) ..
-      p(_[[If you want things to go faster, simply use the PAGE UP key on your keyboard to increase the game speed. You can use PAGE DOWN to make the game slower again.]])
+      p(_[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]])
    ),
    h = 300,
    w = 350
@@ -148,7 +148,7 @@
       p(_[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) ..
       p(_[[Now you have split the road in two parts with a carrier each. This means less work for him and higher efficiency for us. You should therefore always place as many flags as possible on your roads.]]) ..
       p(_[[Now we only have to wait till the hut is finished.]]) ..
-      p(_[[If you want things to go faster, simply use the PAGE UP key on your keyboard to increase the game speed. You can use PAGE DOWN to make the game slower again.]])
+      p(_[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]])
    ),
    h = 350
 }
@@ -265,7 +265,7 @@
       h1(_"Build a Quarry") ..
       paragraphdivider() ..
       listitem_bullet(_[[There are some rocks to the west of your headquarters. Build a quarry right next to them.]]) ..
-      listitem_arrow(_[[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press SPACE for that).]]) ..
+      listitem_arrow(_[[The quarry is a small building like the lumberjack’s hut. You can therefore build it on any field that shows a red, yellow or green house when the building spaces symbols are enabled (Press Space for that).]]) ..
       listitem_arrow(_[[Just click on any house symbol next to the rocks, select the small buildings tab in the window that opens up, then click on the quarry symbol.]])
    )
 }

=== modified file 'campaigns/tutorial02_warfare.wmf/scripting/texts.lua'
--- campaigns/tutorial02_warfare.wmf/scripting/texts.lua	2015-10-31 12:11:44 +0000
+++ campaigns/tutorial02_warfare.wmf/scripting/texts.lua	2015-11-27 17:43:13 +0000
@@ -60,7 +60,7 @@
    obj_body = rt(
       paragraphdivider() ..
       listitem_bullet(_[[Build a battle arena. It is a big building.]]) ..
-      listitem_arrow(_[[Since the construction will take some time, you can change the game speed using PAGE UP and PAGE DOWN.]])
+      listitem_arrow(_[[Since the construction will take some time, you can change the game speed using Page Up and Page Down.]])
    )
 }
 

=== modified file 'maps/Last Bastion.wmf/elemental'
--- maps/Last Bastion.wmf/elemental	2015-11-18 08:41:27 +0000
+++ maps/Last Bastion.wmf/elemental	2015-11-27 17:43:13 +0000
@@ -7,6 +7,6 @@
 nr_players="2"
 name=_"Last Bastion"
 author="Another Barbarian"
-descr=_"The whimsical Gods didn’t answer our prayers. Instead, the increasing sunlight heated up the Earth thousandfold and melted glaciers and people plunged into the deep. But now – high in the majestic mountains, on the last scrap of land – two surviving tribes are sheltering. Even though the Gods showed mercy and the climate thus turned cooler again, the water is still rising and rising. Onto the last secure place – the highest mountain range where the amount of gold and the space to live merely suffice for one tribe – only two opposite paths lead. But remember, be careful… this last living space is also a hard and small place to live. Don’t forget to take care of your timber supplies, you’ll need them."
+descr=_"The whimsical Gods didn’t answer our prayers. Instead, the increasing sunlight heated up the Earth thousandfold and melted glaciers and people were plunged into the deep. But now – high in the majestic mountains, on the last scrap of land – two surviving tribes are sheltering. Even though the Gods showed mercy and the climate thus turned cooler again, the water is still rising and rising. Onto the last secure place – the highest mountain range where the amount of gold and the space to live merely suffice for one tribe – only two opposite paths lead. But remember, be careful… this last living space is also a hard and small place to live. Don’t forget to take care of your timber supplies, you’ll need them."
 hint=
 tags="1v1,artifacts,official"

=== modified file 'src/editor/tools/editor_info_tool.cc'
--- src/editor/tools/editor_info_tool.cc	2015-11-11 09:56:22 +0000
+++ src/editor/tools/editor_info_tool.cc	2015-11-27 17:43:13 +0000
@@ -92,7 +92,7 @@
 	}
 
 	std::string temp = "";
-	temp = f.get_immovable() ? _("Has base immovable") : _("No base immovable");
+	temp = f.get_immovable() ? _("Has immovable") : _("No immovable");
 	buf += "• " + temp + "\n";
 
 	temp = f.get_first_bob() ? _("Has animals") : _("No animals");

=== modified file 'src/logic/production_program.cc'
--- src/logic/production_program.cc	2015-11-11 09:52:55 +0000
+++ src/logic/production_program.cc	2015-11-27 17:43:13 +0000
@@ -1049,10 +1049,11 @@
 	assert(m_items.size());
 
 	std::vector<std::string> ware_descnames;
+	uint8_t count;
 	for (const auto& item_pair : m_items) {
-		uint8_t const count = item_pair.second;
+		count = item_pair.second;
 		std::string ware_descname = tribe.get_ware_descr(item_pair.first)->descname();
-		// TODO(GunChleoc): needs ngettext when we have one_tribe.
+		// TODO(GunChleoc): would be nice with pngettext whenever it gets added to xgettext for Lua.
 		if (1 < count) {
 			/** TRANSLATORS: This is an item in a list of wares, e.g. "Produced 2x Coal": */
 			/** TRANSLATORS:    %%1$i = "2" */
@@ -1065,8 +1066,8 @@
 	}
 	std::string ware_list = i18n::localize_list(ware_descnames, i18n::ConcatenateWith::AND);
 
-	/** TRANSLATORS: %s is a list of wares */
-	const std::string result_string = (boost::format(_("Produced %s")) % ware_list).str();
+	/** TRANSLATORS: %s is a list of wares. String is fetched according to total amount of wares. */
+	const std::string result_string = (boost::format(ngettext("Produced %s", "Produced %s", count)) % ware_list).str();
 	ps.set_production_result(result_string);
 }
 
@@ -1143,10 +1144,11 @@
 	const TribeDescr & tribe = ps.owner().tribe();
 	assert(m_items.size());
 	std::vector<std::string> worker_descnames;
+	uint8_t count;
 	for (const auto& item_pair : m_items) {
-		uint8_t const count = item_pair.second;
+		count = item_pair.second;
 		std::string worker_descname = tribe.get_worker_descr(item_pair.first)->descname();
-		// TODO(GunChleoc): needs ngettext when we have one_tribe.
+		// TODO(GunChleoc): would be nice with pngettext whenever it gets added to xgettext for Lua.
 		if (1 < count) {
 			/** TRANSLATORS: This is an item in a list of workers, e.g. "Recruited 2x Ox": */
 			/** TRANSLATORS:    %1$i = "2" */
@@ -1159,8 +1161,8 @@
 	}
 	std::string unit_string = i18n::localize_list(worker_descnames, i18n::ConcatenateWith::AND);
 
-	/** TRANSLATORS: %s is a list of workers */
-	const std::string result_string = (boost::format(_("Recruited %s")) % unit_string).str();
+	/** TRANSLATORS: %s is a list of workers. String is fetched according to total amount of workers. */
+	const std::string result_string = (boost::format(ngettext("Recruited %s", "Recruited %s", count)) % unit_string).str();
 	ps.set_production_result(result_string);
 }
 

=== modified file 'tribes/buildings/productionsites/empire/mill/helptexts.lua'
--- tribes/buildings/productionsites/empire/mill/helptexts.lua	2015-11-20 16:39:38 +0000
+++ tribes/buildings/productionsites/empire/mill/helptexts.lua	2015-11-27 17:43:13 +0000
@@ -23,5 +23,5 @@
 
 function building_helptext_performance()
    -- TRANSLATORS: Performance helptext for a building
-   return pgettext("empire_building", "The miller needs %1% on average to grind wheat into a sack of corn."):bformat(format_seconds(19))
+   return pgettext("empire_building", "The miller needs %1% on average to grind wheat into a sack of flour."):bformat(format_seconds(19))
 end

=== modified file 'tribes/init.lua'
--- tribes/init.lua	2015-11-02 19:29:03 +0000
+++ tribes/init.lua	2015-11-27 17:43:13 +0000
@@ -10,8 +10,6 @@
 -- Also, enhanced/upgraded units need to come before their basic units.
 --
 
-set_textdomain("tribes")
-
 tribes = wl.Tribes()
 
 

=== modified file 'tribes/scripting/help/building_help.lua'
--- tribes/scripting/help/building_help.lua	2015-11-09 08:42:43 +0000
+++ tribes/scripting/help/building_help.lua	2015-11-27 17:43:13 +0000
@@ -420,8 +420,8 @@
    local result = ""
    if (building_description.max_hp and building_description.min_hp) then
       result = result .. rt(h2(_"Health Training"))
-      result = result .. rt(p(_"Trains ‘%1$s’ from %2$s up to %3$s":
-            bformat(_"Health", building_description.min_hp, building_description.max_hp+1)))
+      result = result .. rt(p(_"Trains ‘Health’ from %1% up to %2%":
+            bformat(building_description.min_hp, building_description.max_hp+1)))
       result = result .. rt(h3(_"Soldiers:"))
       result = result ..
          dependencies_basic({
@@ -434,8 +434,8 @@
    if (building_description.max_attack and building_description.min_attack) then
       result = result .. rt(h2(_"Attack Training"))
       -- TRANSLATORS: %1$s = Health, Evade, Attack or Defense. %2$s and %3$s are numbers.
-      result = result .. rt(p(_"Trains ‘%1$s’ from %2$s up to %3$s":
-         bformat(_"Attack", building_description.min_attack, building_description.max_attack+1)))
+      result = result .. rt(p(_"Trains ‘Attack’ from %1% up to %2%":
+         bformat(building_description.min_attack, building_description.max_attack+1)))
       result = result .. rt(h3(_"Soldiers:")) ..
          dependencies_basic({
             "tribes/workers/" .. tribe.name .. "/soldier/attack_level" .. building_description.min_attack .. ".png",
@@ -446,8 +446,8 @@
    end
    if (building_description.max_defense and building_description.min_defense) then
       result = result .. rt(h2(_"Defense Training"))
-      result = result .. rt(p( _"Trains ‘%1$s’ from %2$s up to %3$s":
-            bformat(_"Defense", building_description.min_defense, building_description.max_defense+1)))
+      result = result .. rt(p( _"Trains ‘Defense’ from %1% up to %2%":
+            bformat(building_description.min_defense, building_description.max_defense+1)))
             result = result .. rt(h3(_"Soldiers:"))
       result = result ..
          dependencies_basic({
@@ -459,8 +459,8 @@
    end
    if (building_description.max_evade and building_description.min_evade) then
       result = result .. rt(h2(_"Evade Training"))
-      result = result .. rt(p( _"Trains ‘%1$s’ from %2$s up to %3$s":
-            bformat(_"Evade", building_description.min_evade, building_description.max_evade+1)))
+      result = result .. rt(p( _"Trains ‘Evade’ from %1% up to %2%":
+            bformat(building_description.min_evade, building_description.max_evade+1)))
       result = result .. rt(h3(_"Soldiers:"))
       result = result ..
          dependencies_basic({

=== modified file 'txts/README.lua'
--- txts/README.lua	2015-11-17 09:26:14 +0000
+++ txts/README.lua	2015-11-27 17:43:13 +0000
@@ -44,21 +44,21 @@
    .. h2(_
 [[General game control]]
    ) .. p(_
-[[To close an open window, right-click on it. To minimize/maximize a window, click on it with the middle mouse button or with the left mouse button while holding down CTRL.]]
+[[To close an open window, right-click on it. To minimize/maximize a window, click on it with the middle mouse button or with the left mouse button while holding down Ctrl.]]
    ) .. p(_
-[[If you hold CTRL while building a road, flags will be placed automatically.
-If you hold CTRL while removing a road, all flags up to the first junction are
+[[If you hold Ctrl while building a road, flags will be placed automatically.
+If you hold Ctrl while removing a road, all flags up to the first junction are
 removed.]]
    ) .. p(_
-[[You can skip confirmation windows for irreversible actions if you hold CTRL
+[[You can skip confirmation windows for irreversible actions if you hold Ctrl
 while clicking on the action button.]]
    ) .. h2(_
 [[Keyboard shortcuts (in-game)]]
    ) .. p(
-_"PAGEUP: increases game speed" .. "<br>"
-.. _"PAGEDOWN: decreases game speed" .. "<br>"
-.. _"PAUSE: pauses the game" .. "<br>"
-.. _"SPACE: toggles if building spaces are shown" .. "<br>"
+_" Page Up: increases game speed" .. "<br>"
+.. _" Page Down: decreases game speed" .. "<br>"
+.. _"Pause: pauses the game" .. "<br>"
+.. _"Space: toggles if building spaces are shown" .. "<br>"
 .. _"M: toggles minimap" .. "<br>"
 .. _"N: toggles messages (‘news’)" .. "<br>"
 .. _"C: toggles census" .. "<br>"
@@ -68,13 +68,13 @@
 .. _"B: toggles building statistics" .. "<br>"
 .. _"F: toggles fullscreen (if supported by the OS)" .. "<br>"
 .. _"Home: centers main mapview on starting location" .. "<br>"
-.. _"(CTRL+) 0-9: Remember and go to previously remembered locations" .. "<br>"
+.. _"(Ctrl +) 0-9: Remember and go to previously remembered locations" .. "<br>"
 .. _",: goes to the previous location" .. "<br>"
 .. _".: goes to the next location" .. "<br>"
 .. _"F6: shows the debug console (only in debug-builds)" .. "<br>"
-.. _"CTRL+F10: quits the game immediately" .. "<br>"
-.. _"CTRL+Leftclick: skips confirmation dialogs" .. "<br>"
-.. _"CTRL+F11: takes a screenshot"
+.. _"Ctrl + F10: quits the game immediately" .. "<br>"
+.. _"Ctrl + Leftclick: skips confirmation dialogs" .. "<br>"
+.. _"Ctrl + F11: takes a screenshot"
    ) .. p(_
 [[In the message window, the following additional shortcuts are available:]]
    ) .. p(
@@ -85,7 +85,7 @@
 .. _ "4: shows warfare messages only" .. "<br>"
 .. _ "5: shows scenario messages only" .. "<br>"
 .. _ "G: jumps to the location corresponding to the current message" .. "<br>"
-.. _"DELETE: archives/restores the current message"
+.. _"Delete: archives/restores the current message"
    ) .. h2(_
 [[Online Help]]
    ) .. p(_"A detailed description of the tribes’ economies is available in the in-game Tribal Encyclopedia." .. " " ..

=== modified file 'txts/editor_readme.lua'
--- txts/editor_readme.lua	2015-11-17 09:26:14 +0000
+++ txts/editor_readme.lua	2015-11-27 17:43:13 +0000
@@ -18,7 +18,7 @@
 
       p(
          -- TRANSLATORS: This is a hotkey
-         _"SPACE:" .. " " .. _"toggles if building spaces are shown" .. "<br>" ..
+         _"Space:" .. " " .. _"toggles if building spaces are shown" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
          _"C:" .. " " .. _"toggles census" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
@@ -34,15 +34,15 @@
          -- TRANSLATORS: This is a hotkey
          _"I:" .. " " .. _"activates information tool" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
-         _"CTRL+L:" .. " " .. _"load map" .. "<br>" ..
+         _"Ctrl + L:" .. " " .. _"load map" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
-         _"CTRL+S:" .. " " .. _"save map" .. "<br>" ..
+         _"Ctrl + S:" .. " " .. _"save map" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
          _"1-0:" .. " " .. _"changes tool size" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
-         _"SHIFT (Hold):" .. " " .. _"selects first alternative tool while pressed" .. "<br>" ..
+         _"Shift (Hold):" .. " " .. _"selects first alternative tool while pressed" .. "<br>" ..
          -- TRANSLATORS: This is a hotkey
-         _"ALT (Hold):" .. " " .. _"Selects second alternative tool while pressed" .. "<br>"
+         _"Alt (Hold):" .. " " .. _"Selects second alternative tool while pressed" .. "<br>"
       )
    )
 }

=== modified file 'txts/tips/editor.tip'
--- txts/tips/editor.tip	2014-07-14 10:45:44 +0000
+++ txts/tips/editor.tip	2015-11-27 17:43:13 +0000
@@ -3,19 +3,19 @@
 sec=6
 
 [Tip 2]
-text=_"You can select multiple animal types if you hold down CTRL during selection. If you then click on the map, an instance of one of the selected animal types will be placed."
+text=_"You can select multiple animal types if you hold down Ctrl during selection. If you then click on the map, an instance of one of the selected animal types will be placed."
 sec=7
 
 [Tip 3]
-text=_"Just like with animals, you can also select multiple immovables or ground textures with CTRL + mouse click."
+text=_"Just like with animals, you can also select multiple immovables or ground textures with Ctrl + mouse click."
 sec=6
 
 [Tip 4]
-text=_"Holding down SHIFT switches the first alternative tool on. This tool is in most cases the complete opposite of the normal tool (for example deletion of an object instead of placing one)."
+text=_"Holding down Shift switches the first alternative tool on. This tool is in most cases the complete opposite of the normal tool (for example deletion of an object instead of placing one)."
 sec=7
 
 [Tip 5]
-text=_"Holding down ALT switches the second alternative tool on (if it exists)."
+text=_"Holding down Alt switches the second alternative tool on (if it exists)."
 sec=6
 
 [Tip 6]
@@ -23,6 +23,6 @@
 sec=6
 
 [Tip 7]
-text=_"SPACE key behaves like in normal game. It switches if building spaces are shown on or off."
+text=_"Space key behaves like in normal game. It switches if building spaces are shown on or off."
 sec=6
 

=== modified file 'utils/buildcat.py'
--- utils/buildcat.py	2015-11-06 18:57:00 +0000
+++ utils/buildcat.py	2015-11-27 17:43:13 +0000
@@ -58,8 +58,9 @@
         "../../world/*/*/*/*/*/*.lua",
     ]),
     ("tribes/tribes", [
-        "../../tribes/scripting/starting_conditions/*/*.lua"
+        "../../tribes/scripting/starting_conditions/*/*.lua" # TODO(GunChleoc): the starting conditions aren't being picked up.
         "../../tribes/*.lua",
+        "../../tribes/preload.lua", # TODO(GunChleoc): Why do I have to load both *.lua and preload.lua for this to work?
         "../../tribes/*/init.lua",
         "../../tribes/*/*/init.lua",
         "../../tribes/*/*/*/init.lua",


Follow ups