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

Proposed by GunChleoc
Status: Merged
Merged at revision: 6868
Proposed branch: lp:~widelands-dev/widelands/bug-999262
Merge into: lp:widelands
Diff against target: 33 lines (+5/-9)
1 file modified
src/logic/worker.cc (+5/-9)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-999262
Reviewer Review Type Date Requested Status
SirVer Pending
Review via email: mp+210166@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

pretty hacky solution, but workable for now. We have a meddle between engine and data files in more places.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
595 if (building.name() == "fish_breeders_house")595 if (building.name() == "fish_breeders_house")
596 return;596 return;
597597
598 // TODO "stone" is defined as "granit" in the worlds
599 if (res_type == "stone") res_type = "granit";
600
598 // Translate the Resource name (if it is defined by the world)601 // Translate the Resource name (if it is defined by the world)
599 const World & world = game.map().world();602 const World & world = game.map().world();
600 int32_t residx = world.get_resource(res_type.c_str());603 int32_t residx = world.get_resource(res_type.c_str());
601 if (residx != -1)604 if (residx != -1)
602 res_type = world.get_resource(residx)->descname();605 res_type = world.get_resource(residx)->descname();
603606
604 // NOTE mirroring the above ugly hack.
605 // Avoiding placeholders for the resouce names to avert grammar trouble in translations.
606 std::string out_of_message = _("Out of Resources");
607 if (res_type == "fish") out_of_message = _("Out of Fish");
608 else if (res_type == "stone") out_of_message = _("Out of Stone");
609
610 building.send_message607 building.send_message
611 (game,608 (game,
612 "mine",609 "mine",
613 out_of_message,610 (boost::format(_("Out of %s")) % res_type).str(),
614 (boost::format(_("The worker of this building cannot find any more resources "611 (boost::format(_("The worker of this building cannot find any more %s.")) % res_type).str(),
615 "of the following type: %s")) % res_type).str(),
616 true,612 true,
617 1800000, 0);613 1800000, 0);
618}614}

Subscribers

People subscribed via source and target branches

to status/vote changes: