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

Proposed by GunChleoc
Status: Merged
Merged at revision: 7523
Proposed branch: lp:~widelands-dev/widelands/string-fixes
Merge into: lp:widelands
Diff against target: 285 lines (+53/-32)
12 files modified
campaigns/tutorial04_economy.wmf/scripting/texts.lua (+3/-3)
maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua (+1/-1)
src/editor/map_generator.cc (+1/-1)
src/editor/ui_menus/editor_player_menu.cc (+29/-17)
src/editor/ui_menus/editor_player_menu.h (+9/-1)
src/logic/productionsite.cc (+1/-1)
src/logic/ship.cc (+1/-1)
src/ui_fsmenu/loadgame.cc (+3/-3)
src/ui_fsmenu/options.cc (+2/-2)
src/wui/building_statistics_menu.cc (+1/-0)
tribes/atlanteans/horsebreeder/conf (+1/-1)
utils/lua_xgettext.py (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/string-fixes
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+270159@code.launchpad.net

Description of the change

1. Made some untranslatable strings localizable.

2. Fixed xgettext for Lua. Comments in .pot files need to be introduced by "#." rather than "#:" - "#:" is for occurrences.

3. Small string fixes for Tutorial 4 and ships.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'campaigns/tutorial04_economy.wmf/scripting/texts.lua'
--- campaigns/tutorial04_economy.wmf/scripting/texts.lua 2015-06-10 16:50:57 +0000
+++ campaigns/tutorial04_economy.wmf/scripting/texts.lua 2015-09-04 11:07:32 +0000
@@ -82,7 +82,7 @@
82 paragraphdivider() ..82 paragraphdivider() ..
83 listitem_bullet(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..83 listitem_bullet(_[[‘2/1’ below the quarry: This means that you have two quarries, plus another one which is under construction.]]) ..
84 listitem_bullet(_[[‘0%’: This indicates the average productivity of all buildings of that type. You have just started this game, therefore none of your buildings has done any work yet, but they are going to start working soon.]]) ..84 listitem_bullet(_[[‘0%’: This indicates the average productivity of all buildings of that type. You have just started this game, therefore none of your buildings has done any work yet, but they are going to start working soon.]]) ..
85 listitem_bullet(_[[‘2/4’ below your sentry: For military buildings, the stationed soldiers are shown instead of a productivity. You want to have four soldiers in your sentries, but only two soldiers are stationed in this kind of building. This leaves two vacant positions — we really need more soldiers.]]) ..85 listitem_bullet(_[[‘2/4’ below your sentry: For military buildings, the stationed soldiers are shown instead of a productivity. You want to have four soldiers in your sentries, but only two soldiers are stationed in this kind of building. This leaves two vacant positions – we really need more soldiers.]]) ..
86 listitem_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..86 listitem_arrow(_[[In both cases, the color (green - yellow - red) signals you how good the value is.]]) ..
87 listitem_bullet(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..87 listitem_bullet(_[[If you click on a building, you can scroll through the buildings of the selected type.]]) ..
88 listitem_bullet(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]])88 listitem_bullet(_[[If you don’t have any building of a particular building type, it will be shown greyed out.]])
@@ -392,7 +392,7 @@
392 body = rt(392 body = rt(
393 p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..393 p(_[[This window looks similar to the stock window, but it has additional buttons at the bottom.]]) ..
394 p(_[[You first have to select one or more wares (you can also left-click and drag). Then you can set the desired target quantity for the selected wares.]]) ..394 p(_[[You first have to select one or more wares (you can also left-click and drag). Then you can set the desired target quantity for the selected wares.]]) ..
395 p(_[[Most buildings will only produce something when when the stock level in your warehouses falls below the target quantity, so you should indicate the reserve you want to stockpile.]]) ..395 p(_[[Most buildings will only produce something when the stock level in your warehouses falls below the target quantity, so you should indicate the reserve you want to stockpile.]]) ..
396 p(_[[An example: the default value for scythes is 1. If you build a farm, a carrier will take a scythe and become a farmer. Then there will be no scythes left, but the target quantity is 1, therefore your toolsmith will start producing another one.]]) ..396 p(_[[An example: the default value for scythes is 1. If you build a farm, a carrier will take a scythe and become a farmer. Then there will be no scythes left, but the target quantity is 1, therefore your toolsmith will start producing another one.]]) ..
397 p(_[[If you build two farms, only one of them will start working immediately. The second farm will have to wait for its worker, who will lack a scythe. If you had set the target quantity to 2 before, two scythes would have been available and both farms would have been able to start working right away.]])397 p(_[[If you build two farms, only one of them will start working immediately. The second farm will have to wait for its worker, who will lack a scythe. If you had set the target quantity to 2 before, two scythes would have been available and both farms would have been able to start working right away.]])
398 ),398 ),
@@ -425,7 +425,7 @@
425 title = _"Warehouse Preferences",425 title = _"Warehouse Preferences",
426 body = rt(426 body = rt(
427 h1(_[[Bring the marble columns to the front line]]) ..427 h1(_[[Bring the marble columns to the front line]]) ..
428 p(_[[It is great that we are producing marble columns, but it would be great if they were stored where we need them.]]) ..428 p(_[[The production of marble columns is working fine now, but it would be great if they were stored where we need them.]]) ..
429 p(_[[Normally, produced wares are brought to the closest warehouse if they are not needed elsewhere. In this case, this means our headquarters. But we would like to have them in the warehouse near our fortresses.]]) ..429 p(_[[Normally, produced wares are brought to the closest warehouse if they are not needed elsewhere. In this case, this means our headquarters. But we would like to have them in the warehouse near our fortresses.]]) ..
430 p(_[[Every warehouse has four buttons to set the preference. If you move your mouse pointer over them, you will see tooltips that explain what the buttons do.]]) ..430 p(_[[Every warehouse has four buttons to set the preference. If you move your mouse pointer over them, you will see tooltips that explain what the buttons do.]]) ..
431 paragraphdivider() ..431 paragraphdivider() ..
432432
=== modified file 'maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua'
--- maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua 2014-10-02 11:45:56 +0000
+++ maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua 2015-09-04 11:07:32 +0000
@@ -131,7 +131,7 @@
131 return ngettext("%s Gold Ore","%s Gold Ore",count):bformat(count)131 return ngettext("%s Gold Ore","%s Gold Ore",count):bformat(count)
132 else132 else
133 -- TRANSLATORS: number + resource name, e.g. '1 stone'133 -- TRANSLATORS: number + resource name, e.g. '1 stone'
134 return (_"%1$i %2$s"):bformat(count, resource)134 return ("%1$i %2$s"):bformat(count, resource)
135 end135 end
136end136end
137137
138138
=== modified file 'src/editor/map_generator.cc'
--- src/editor/map_generator.cc 2015-01-31 16:03:59 +0000
+++ src/editor/map_generator.cc 2015-09-04 11:07:32 +0000
@@ -792,7 +792,7 @@
792792
793 for (PlayerNumber n = 1; n <= map_info_.numPlayers; ++n) {793 for (PlayerNumber n = 1; n <= map_info_.numPlayers; ++n) {
794 // Set scenario information - needed even if it's not a scenario794 // Set scenario information - needed even if it's not a scenario
795 map_.set_scenario_player_name(n, "Random Player");795 map_.set_scenario_player_name(n, _("Random Player"));
796 map_.set_scenario_player_tribe(n, tribe);796 map_.set_scenario_player_tribe(n, tribe);
797 map_.set_scenario_player_ai(n, ai);797 map_.set_scenario_player_ai(n, ai);
798 map_.set_scenario_player_closeable(n, false);798 map_.set_scenario_player_closeable(n, false);
799799
=== modified file 'src/editor/ui_menus/editor_player_menu.cc'
--- src/editor/ui_menus/editor_player_menu.cc 2015-09-04 06:16:58 +0000
+++ src/editor/ui_menus/editor_player_menu.cc 2015-09-04 11:07:32 +0000
@@ -31,6 +31,7 @@
31#include "logic/player.h"31#include "logic/player.h"
32#include "logic/tribe.h"32#include "logic/tribe.h"
33#include "logic/warehouse.h"33#include "logic/warehouse.h"
34#include "profile/profile.h"
34#include "ui_basic/editbox.h"35#include "ui_basic/editbox.h"
35#include "ui_basic/messagebox.h"36#include "ui_basic/messagebox.h"
36#include "ui_basic/textarea.h"37#include "ui_basic/textarea.h"
@@ -70,7 +71,17 @@
70 int32_t const width = 20;71 int32_t const width = 20;
71 int32_t posy = 0;72 int32_t posy = 0;
7273
73 m_tribes = Widelands::TribeDescr::get_all_tribenames();74 // Initializing the descnames for the tribes.
75 for (const std::string& tribename : Widelands::TribeDescr::get_all_tribenames()) {
76 std::string tribepath("tribes/" + tribename);
77 // get translated tribesname
78 Profile prof
79 ((tribepath + "/conf").c_str(), nullptr, "tribe_" + tribename);
80 Section & global = prof.get_safe_section("tribe");
81 const char* descname = global.get_safe_string("name");
82 m_tribenames.push_back(tribename);
83 m_tribe_descnames.emplace(tribename, descname);
84 }
7485
75 set_inner_size(375, 135);86 set_inner_size(375, 135);
7687
@@ -162,13 +173,15 @@
162 (boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1));173 (boost::bind(&EditorPlayerMenu::player_tribe_clicked, boost::ref(*this), p - 1));
163 posx += 140 + spacing;174 posx += 140 + spacing;
164 }175 }
165 if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME)176
166 m_plr_set_tribes_buts[p - 1]->set_title177 // Get/Set (localized) tribe names
167 (map.get_scenario_player_tribe(p).c_str());178 if (map.get_scenario_player_tribe(p) != UNDEFINED_TRIBE_NAME) {
168 else {179 m_selected_tribes[p] = map.get_scenario_player_tribe(p);
169 m_plr_set_tribes_buts[p - 1]->set_title(m_tribes[0].c_str());180 } else {
170 map.set_scenario_player_tribe(p, m_tribes[0]);181 m_selected_tribes[p] = m_tribenames[0];
182 map.set_scenario_player_tribe(p, m_selected_tribes[p]);
171 }183 }
184 m_plr_set_tribes_buts[p - 1]->set_title(m_tribe_descnames.find(m_selected_tribes[p])->second);
172185
173 // Set default AI and closeable to false (always default - should be changed by hand)186 // Set default AI and closeable to false (always default - should be changed by hand)
174 map.set_scenario_player_ai(p, "");187 map.set_scenario_player_ai(p, "");
@@ -206,7 +219,7 @@
206 const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str();219 const std::string name = (boost::format(_("Player %u")) % static_cast<unsigned int>(nr_players)).str();
207 map.set_scenario_player_name(nr_players, name);220 map.set_scenario_player_name(nr_players, name);
208 }221 }
209 map.set_scenario_player_tribe(nr_players, m_tribes[0]);222 map.set_scenario_player_tribe(nr_players, m_tribenames[0]);
210 eia().set_need_save(true);223 eia().set_need_save(true);
211 m_add_player .set_enabled(nr_players < MAX_PLAYERS);224 m_add_player .set_enabled(nr_players < MAX_PLAYERS);
212 m_remove_last_player.set_enabled(true);225 m_remove_last_player.set_enabled(true);
@@ -248,17 +261,16 @@
248 */261 */
249void EditorPlayerMenu::player_tribe_clicked(uint8_t n) {262void EditorPlayerMenu::player_tribe_clicked(uint8_t n) {
250 EditorInteractive& menu = eia();263 EditorInteractive& menu = eia();
251 if (!menu.is_player_tribe_referenced(n + 1)) {264 if (!menu.is_player_tribe_referenced(n + 1)) {
252 std::string t = m_plr_set_tribes_buts[n]->get_title();265 if (!Widelands::TribeDescr::exists_tribe(m_selected_tribes[n + 1]))
253 if (!Widelands::TribeDescr::exists_tribe(t))
254 throw wexception266 throw wexception
255 ("Map defines tribe %s, but it does not exist!", t.c_str());267 ("Map defines tribe %s, but it does not exist!", m_selected_tribes[n + 1].c_str());
256 uint32_t i;268 uint32_t i;
257 for (i = 0; i < m_tribes.size(); ++i)269 for (i = 0; i < m_tribenames.size(); ++i)
258 if (m_tribes[i] == t)270 if (m_tribenames[i] == m_selected_tribes[n + 1])
259 break;271 break;
260 t = i == m_tribes.size() - 1 ? m_tribes[0] : m_tribes[++i];272 m_selected_tribes[n + 1] = i == m_tribenames.size() - 1 ? m_tribenames[0] : m_tribenames[++i];
261 menu.egbase().map().set_scenario_player_tribe(n + 1, t);273 menu.egbase().map().set_scenario_player_tribe(n + 1, m_selected_tribes[n + 1]);
262 menu.set_need_save(true);274 menu.set_need_save(true);
263 } else {275 } else {
264 UI::WLMessageBox mmb276 UI::WLMessageBox mmb
@@ -337,7 +349,7 @@
337 // so that this tribe can not be changed349 // so that this tribe can not be changed
338 egbase.add_player350 egbase.add_player
339 (n, 0, // TODO(SirVer): initialization index makes no sense here351 (n, 0, // TODO(SirVer): initialization index makes no sense here
340 m_plr_set_tribes_buts[n - 1]->get_title(),352 m_tribe_descnames.find(m_selected_tribes[n])->second,
341 m_plr_names[n - 1]->text());353 m_plr_names[n - 1]->text());
342354
343 p = egbase.get_player(n);355 p = egbase.get_player(n);
344356
=== modified file 'src/editor/ui_menus/editor_player_menu.h'
--- src/editor/ui_menus/editor_player_menu.h 2014-11-28 12:53:24 +0000
+++ src/editor/ui_menus/editor_player_menu.h 2015-09-04 11:07:32 +0000
@@ -21,6 +21,7 @@
21#define WL_EDITOR_UI_MENUS_EDITOR_PLAYER_MENU_H21#define WL_EDITOR_UI_MENUS_EDITOR_PLAYER_MENU_H
2222
23#include <cstring>23#include <cstring>
24#include <map>
24#include <string>25#include <string>
25#include <vector>26#include <vector>
2627
@@ -54,7 +55,14 @@
54 * m_plr_make_infrastructure_buts[MAX_PLAYERS],55 * m_plr_make_infrastructure_buts[MAX_PLAYERS],
55 * m_plr_set_pos_buts [MAX_PLAYERS],56 * m_plr_set_pos_buts [MAX_PLAYERS],
56 * m_plr_set_tribes_buts [MAX_PLAYERS];57 * m_plr_set_tribes_buts [MAX_PLAYERS];
57 std::vector<std::string> m_tribes;58
59 std::vector<std::string> m_tribenames;
60
61 /// tribename, descname
62 std::map<std::string, std::string> m_tribe_descnames;
63
64 /// List of the tribes currently selected for all players
65 std::string m_selected_tribes[MAX_PLAYERS];
5866
59 int32_t m_posy;67 int32_t m_posy;
6068
6169
=== modified file 'src/logic/productionsite.cc'
--- src/logic/productionsite.cc 2015-06-24 20:25:35 +0000
+++ src/logic/productionsite.cc 2015-09-04 11:07:32 +0000
@@ -317,7 +317,7 @@
317 else317 else
318 color = UI_FONT_CLR_GOOD.hex_value();318 color = UI_FONT_CLR_GOOD.hex_value();
319 const std::string perc_str =319 const std::string perc_str =
320 (boost::format("<font color=%s>%i%%</font>") % color % percOk).str();320 (boost::format("<font color=%s>%s</font>") % color % (boost::format(_("%i%%")) % percOk)).str();
321321
322 std::string trend;322 std::string trend;
323 if (lastPercOk > percOk) {323 if (lastPercOk > percOk) {
324324
=== modified file 'src/logic/ship.cc'
--- src/logic/ship.cc 2015-08-31 19:40:34 +0000
+++ src/logic/ship.cc 2015-09-04 11:07:32 +0000
@@ -661,7 +661,7 @@
661 }661 }
662 } else { // it seems that port constructionsite has dissapeared662 } else { // it seems that port constructionsite has dissapeared
663 // Send a message to the player, that a port constructionsite is gone663 // Send a message to the player, that a port constructionsite is gone
664 std::string msg_head = _("New port constructionsite is gone");664 std::string msg_head = _("New port construction site is gone");
665 std::string msg_body = _("Unloading of wares failed, expedition is cancelled now.");665 std::string msg_body = _("Unloading of wares failed, expedition is cancelled now.");
666 send_message(game, msg_head, msg_body, "port.png");666 send_message(game, msg_head, msg_body, "port.png");
667 send_signal(game, "cancel_expedition");667 send_signal(game, "cancel_expedition");
668668
=== modified file 'src/ui_fsmenu/loadgame.cc'
--- src/ui_fsmenu/loadgame.cc 2015-09-04 06:16:58 +0000
+++ src/ui_fsmenu/loadgame.cc 2015-09-04 11:07:32 +0000
@@ -182,14 +182,14 @@
182 if (m_is_replay) {182 if (m_is_replay) {
183 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */183 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */
184 /** TRANSLATORS: Make sure that you keep consistency in your translation. */184 /** TRANSLATORS: Make sure that you keep consistency in your translation. */
185 modes.push_back("SP = Single Player");185 modes.push_back(_("SP = Single Player"));
186 }186 }
187 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */187 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */
188 /** TRANSLATORS: Make sure that you keep consistency in your translation. */188 /** TRANSLATORS: Make sure that you keep consistency in your translation. */
189 modes.push_back("MP = Multiplayer");189 modes.push_back(_("MP = Multiplayer"));
190 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */190 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */
191 /** TRANSLATORS: Make sure that you keep consistency in your translation. */191 /** TRANSLATORS: Make sure that you keep consistency in your translation. */
192 modes.push_back("H = Multiplayer (Host)");192 modes.push_back(_("H = Multiplayer (Host)"));
193 const std::string mode_tooltip_1 =193 const std::string mode_tooltip_1 =
194 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */194 /** TRANSLATORS: Tooltip for the "Mode" column when choosing a game/replay to load. */
195 /** TRANSLATORS: %s is a list of game modes. */195 /** TRANSLATORS: %s is a list of game modes. */
196196
=== modified file 'src/ui_fsmenu/options.cc'
--- src/ui_fsmenu/options.cc 2015-08-06 17:14:34 +0000
+++ src/ui_fsmenu/options.cc 2015-09-04 11:07:32 +0000
@@ -563,7 +563,7 @@
563 (this,563 (this,
564 m_hmargin + m_message_sound.get_w() + m_padding, m_message_sound.get_y(),564 m_hmargin + m_message_sound.get_w() + m_padding, m_message_sound.get_y(),
565 get_w() - 2 * m_hmargin - m_message_sound.get_w() - m_padding, 40,565 get_w() - 2 * m_hmargin - m_message_sound.get_w() - m_padding, 40,
566 _("Play a sound at message arrival."),566 _("Play a sound at message arrival"),
567 UI::Align_VCenter),567 UI::Align_VCenter),
568568
569 m_nozip (this, Point(m_hmargin,569 m_nozip (this, Point(m_hmargin,
@@ -573,7 +573,7 @@
573 (this,573 (this,
574 m_hmargin + m_nozip.get_w() + m_padding, m_nozip.get_y(),574 m_hmargin + m_nozip.get_w() + m_padding, m_nozip.get_y(),
575 get_w() - 2 * m_hmargin - m_nozip.get_w() - m_padding, 40,575 get_w() - 2 * m_hmargin - m_nozip.get_w() - m_padding, 40,
576 _("Do not zip widelands data files (maps, replays and savegames)."),576 _("Do not zip widelands data files (maps, replays and savegames)"),
577 UI::Align_VCenter),577 UI::Align_VCenter),
578578
579 m_remove_syncstreams (this, Point(m_hmargin,579 m_remove_syncstreams (this, Point(m_hmargin,
580580
=== modified file 'src/wui/building_statistics_menu.cc'
--- src/wui/building_statistics_menu.cc 2015-09-04 06:16:58 +0000
+++ src/wui/building_statistics_menu.cc 2015-09-04 11:07:32 +0000
@@ -664,6 +664,7 @@
664 color = UI_FONT_CLR_GOOD;664 color = UI_FONT_CLR_GOOD;
665 }665 }
666 /** TRANSLATORS: Percent in building statistics window, e.g. 85% */666 /** TRANSLATORS: Percent in building statistics window, e.g. 85% */
667 /** TRANSLATORS: If you wish to add a space, translate as '%i %%' */
667 const std::string perc_str = (boost::format(_("%i%%")) % percent).str();668 const std::string perc_str = (boost::format(_("%i%%")) % percent).str();
668 set_labeltext_autosize(productivity_labels_[id], perc_str, color);669 set_labeltext_autosize(productivity_labels_[id], perc_str, color);
669 }670 }
670671
=== modified file 'tribes/atlanteans/horsebreeder/conf'
--- tribes/atlanteans/horsebreeder/conf 2015-08-02 07:09:49 +0000
+++ tribes/atlanteans/horsebreeder/conf 2015-09-04 11:07:32 +0000
@@ -1,4 +1,4 @@
1help=_"Breeds the strong Atlantean horses"1help=_"Breeds the strong Atlantean horses."
22
3[buildcost]3[buildcost]
4carrier=14carrier=1
55
=== modified file 'utils/lua_xgettext.py'
--- utils/lua_xgettext.py 2015-07-27 10:38:23 +0000
+++ utils/lua_xgettext.py 2015-09-04 11:07:32 +0000
@@ -277,7 +277,7 @@
277 comments = sorted(277 comments = sorted(
278 set(f['translator_comment'] for f in occurences if 'translator_comment' in f))278 set(f['translator_comment'] for f in occurences if 'translator_comment' in f))
279 for comment in comments:279 for comment in comments:
280 lines.append('#: %s' % (comment))280 lines.append('#. %s' % (comment))
281 for occurence in occurences:281 for occurence in occurences:
282 lines.append('#: %s:%i' % (os.path.normpath(occurence['filename']),282 lines.append('#: %s:%i' % (os.path.normpath(occurence['filename']),
283 occurence['line']))283 occurence['line']))

Subscribers

People subscribed via source and target branches

to status/vote changes: