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
1=== modified file 'src/logic/worker.cc'
2--- src/logic/worker.cc 2014-03-09 10:28:39 +0000
3+++ src/logic/worker.cc 2014-03-10 09:56:41 +0000
4@@ -595,24 +595,20 @@
5 if (building.name() == "fish_breeders_house")
6 return;
7
8+ // TODO "stone" is defined as "granit" in the worlds
9+ if (res_type == "stone") res_type = "granit";
10+
11 // Translate the Resource name (if it is defined by the world)
12 const World & world = game.map().world();
13 int32_t residx = world.get_resource(res_type.c_str());
14 if (residx != -1)
15 res_type = world.get_resource(residx)->descname();
16
17- // NOTE mirroring the above ugly hack.
18- // Avoiding placeholders for the resouce names to avert grammar trouble in translations.
19- std::string out_of_message = _("Out of Resources");
20- if (res_type == "fish") out_of_message = _("Out of Fish");
21- else if (res_type == "stone") out_of_message = _("Out of Stone");
22-
23 building.send_message
24 (game,
25 "mine",
26- out_of_message,
27- (boost::format(_("The worker of this building cannot find any more resources "
28- "of the following type: %s")) % res_type).str(),
29+ (boost::format(_("Out of %s")) % res_type).str(),
30+ (boost::format(_("The worker of this building cannot find any more %s.")) % res_type).str(),
31 true,
32 1800000, 0);
33 }

Subscribers

People subscribed via source and target branches

to status/vote changes: