← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-999262 into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-999262 into lp:widelands.

Requested reviews:
  SirVer (sirver)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-999262/+merge/210166

All resource names are now localized in "Out of resources" messages.

Please note that there's an ugly hack in worker.cc:

	if (res_type == "stone") res_type = "granit";

I guess this could be fixed in the one_world branch

https://code.launchpad.net/~widelands-dev/widelands/one_world

since this seems to be a conf issue of some sort.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-999262/+merge/210166
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-999262.
=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc	2014-03-09 10:28:39 +0000
+++ src/logic/worker.cc	2014-03-10 09:56:41 +0000
@@ -595,24 +595,20 @@
 	if (building.name() == "fish_breeders_house")
 		return;
 
+	// TODO "stone" is defined as "granit" in the worlds
+	if (res_type == "stone") res_type = "granit";
+
 	// Translate the Resource name (if it is defined by the world)
 	const World & world = game.map().world();
 	int32_t residx = world.get_resource(res_type.c_str());
 	if (residx != -1)
 		res_type = world.get_resource(residx)->descname();
 
-	// NOTE mirroring the above ugly hack.
-	// Avoiding placeholders for the resouce names to avert grammar trouble in translations.
-	std::string out_of_message = _("Out of Resources");
-	if (res_type == "fish") out_of_message = _("Out of Fish");
-	else if (res_type == "stone") out_of_message = _("Out of Stone");
-
 	building.send_message
 		(game,
 		 "mine",
-		 out_of_message,
-		 (boost::format(_("The worker of this building cannot find any more resources "
-		 	 "of the following type: %s")) % res_type).str(),
+		 (boost::format(_("Out of %s")) % res_type).str(),
+		 (boost::format(_("The worker of this building cannot find any more %s.")) % res_type).str(),
 		 true,
 		 1800000, 0);
 }


Follow ups