widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #09612
[Merge] lp:~widelands-dev/widelands/disambiguate_production_program_names into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/disambiguate_production_program_names into lp:widelands.
Commit message:
Production program descnames can now be fetched by pgettext as well as plain gettext. Updated documentation for production programs.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/disambiguate_production_program_names/+merge/316933
This will allow the German locale to distinguish between Barbarian "warriors" ("Krieger") and the other 2 tribes' soldiers ("Soldaten").
I also disambiguated the 3 breads, and carrier2 for consistency.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/disambiguate_production_program_names into lp:widelands.
=== modified file 'data/tribes/buildings/productionsites/atlanteans/bakery/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/bakery/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/atlanteans/bakery/init.lua 2017-02-10 09:46:19 +0000
@@ -52,7 +52,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start baking bread because ...
- descname = _"baking bread",
+ descname = pgettext("atlanteans_building", "baking bread"),
actions = {
"sleep=35000",
"return=skipped unless economy needs atlanteans_bread",
=== modified file 'data/tribes/buildings/productionsites/atlanteans/barracks/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/barracks/init.lua 2016-11-12 06:50:18 +0000
+++ data/tribes/buildings/productionsites/atlanteans/barracks/init.lua 2017-02-10 09:46:19 +0000
@@ -55,7 +55,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
- descname = _"recruiting soldier",
+ descname = pgettext("atlanteans_building", "recruiting soldier"),
actions = {
"sleep=15000",
"return=skipped unless economy needs atlanteans_soldier",
=== modified file 'data/tribes/buildings/productionsites/atlanteans/horsefarm/init.lua'
--- data/tribes/buildings/productionsites/atlanteans/horsefarm/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/atlanteans/horsefarm/init.lua 2017-02-10 09:46:19 +0000
@@ -49,7 +49,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start breeding horses because ...
- descname = _"breeding horses",
+ descname = pgettext("atlanteans_building", "breeding horses"),
actions = {
"sleep=15000",
"return=skipped unless economy needs atlanteans_horse",
=== modified file 'data/tribes/buildings/productionsites/barbarians/bakery/init.lua'
--- data/tribes/buildings/productionsites/barbarians/bakery/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/barbarians/bakery/init.lua 2017-02-10 09:46:19 +0000
@@ -55,7 +55,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start baking bread because ...
- descname = _"baking bread",
+ descname = pgettext("barbarians_building", "baking pitta bread"),
actions = {
"sleep=20000",
"return=skipped unless economy needs barbarians_bread",
=== modified file 'data/tribes/buildings/productionsites/barbarians/barracks/init.lua'
--- data/tribes/buildings/productionsites/barbarians/barracks/init.lua 2016-11-12 06:50:18 +0000
+++ data/tribes/buildings/productionsites/barbarians/barracks/init.lua 2017-02-10 09:46:19 +0000
@@ -53,7 +53,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
- descname = _"recruiting soldier",
+ descname = pgettext("barbarians_building", "recruiting soldier"),
actions = {
"sleep=15000",
"return=skipped unless economy needs barbarians_soldier",
=== modified file 'data/tribes/buildings/productionsites/barbarians/cattlefarm/init.lua'
--- data/tribes/buildings/productionsites/barbarians/cattlefarm/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/barbarians/cattlefarm/init.lua 2017-02-10 09:46:19 +0000
@@ -49,7 +49,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start rearing cattle because ...
- descname = _"rearing cattle",
+ descname = pgettext("barbarians_building", "rearing cattle"),
actions = {
"sleep=15000",
"return=skipped unless economy needs barbarians_ox",
=== modified file 'data/tribes/buildings/productionsites/empire/bakery/init.lua'
--- data/tribes/buildings/productionsites/empire/bakery/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/empire/bakery/init.lua 2017-02-10 09:46:19 +0000
@@ -55,7 +55,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start baking bread because ...
- descname = _"baking bread",
+ descname = pgettext("empire_building", "baking bread"),
actions = {
"sleep=15000",
"return=skipped unless economy needs empire_bread",
=== modified file 'data/tribes/buildings/productionsites/empire/barracks/init.lua'
--- data/tribes/buildings/productionsites/empire/barracks/init.lua 2016-11-12 06:50:18 +0000
+++ data/tribes/buildings/productionsites/empire/barracks/init.lua 2017-02-10 09:46:19 +0000
@@ -56,7 +56,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
- descname = _"recruiting soldier",
+ descname = pgettext("empire_building", "recruiting soldier"),
actions = {
"sleep=15000",
"return=skipped unless economy needs empire_soldier",
=== modified file 'data/tribes/buildings/productionsites/empire/donkeyfarm/init.lua'
--- data/tribes/buildings/productionsites/empire/donkeyfarm/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/productionsites/empire/donkeyfarm/init.lua 2017-02-10 09:46:19 +0000
@@ -49,7 +49,7 @@
programs = {
work = {
-- TRANSLATORS: Completed/Skipped/Did not start rearing donkeys because ...
- descname = _"rearing donkeys",
+ descname = pgettext("empire_building", "rearing donkeys"),
actions = {
"sleep=15000",
"return=skipped unless economy needs empire_donkey",
=== modified file 'data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua'
--- data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua 2016-10-18 09:06:47 +0000
+++ data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua 2017-02-10 09:46:19 +0000
@@ -161,7 +161,7 @@
},
upgrade_soldier_attack_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 0 to level 1",
+ descname = pgettext("atlanteans_building", "upgrading soldier attack from level 0 to level 1"),
actions = {
"check_soldier=soldier attack 0",
"sleep=30000",
@@ -172,7 +172,7 @@
},
upgrade_soldier_attack_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 1 to level 2",
+ descname = pgettext("atlanteans_building", "upgrading soldier attack from level 1 to level 2"),
actions = {
"check_soldier=soldier attack 1",
"sleep=30000",
@@ -183,7 +183,7 @@
},
upgrade_soldier_attack_2 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 2 to level 3",
+ descname = pgettext("atlanteans_building", "upgrading soldier attack from level 2 to level 3"),
actions = {
"check_soldier=soldier attack 2",
"sleep=30000",
@@ -194,7 +194,7 @@
},
upgrade_soldier_attack_3 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 3 to level 4",
+ descname = pgettext("atlanteans_building", "upgrading soldier attack from level 3 to level 4"),
actions = {
"check_soldier=soldier attack 3",
"sleep=30000",
=== modified file 'data/tribes/buildings/trainingsites/atlanteans/labyrinth/init.lua'
--- data/tribes/buildings/trainingsites/atlanteans/labyrinth/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/atlanteans/labyrinth/init.lua 2017-02-10 09:46:19 +0000
@@ -99,7 +99,7 @@
},
upgrade_soldier_defense_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier defense from level 0 to level 1",
+ descname = pgettext("atlanteans_building", "upgrading soldier defense from level 0 to level 1"),
actions = {
"check_soldier=soldier defense 0", -- Fails when aren't any soldier of level 0 defense
"sleep=30000",
@@ -110,7 +110,7 @@
},
upgrade_soldier_defense_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier defense from level 1 to level 2",
+ descname = pgettext("atlanteans_building", "upgrading soldier defense from level 1 to level 2"),
actions = {
"check_soldier=soldier defense 1", -- Fails when aren't any soldier of level 1 defense
"sleep=30000",
@@ -121,7 +121,7 @@
},
upgrade_soldier_health_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 0 to level 1",
+ descname = pgettext("atlanteans_building", "upgrading soldier health from level 0 to level 1"),
actions = {
"check_soldier=soldier health 0", -- Fails when aren't any soldier of level 0 health
"sleep=30000",
@@ -132,7 +132,7 @@
},
upgrade_soldier_evade_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 0 to level 1",
+ descname = pgettext("atlanteans_building", "upgrading soldier evade from level 0 to level 1"),
actions = {
"check_soldier=soldier evade 0", -- Fails when aren't any soldier of level 0 evade
"sleep=30000",
@@ -143,7 +143,7 @@
},
upgrade_soldier_evade_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 1 to level 2",
+ descname = pgettext("atlanteans_building", "upgrading soldier evade from level 1 to level 2"),
actions = {
"check_soldier=soldier evade 1", -- Fails when aren't any soldier of level 1 evade
"sleep=30000",
=== modified file 'data/tribes/buildings/trainingsites/barbarians/battlearena/init.lua'
--- data/tribes/buildings/trainingsites/barbarians/battlearena/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/barbarians/battlearena/init.lua 2017-02-10 09:46:19 +0000
@@ -88,7 +88,7 @@
},
upgrade_soldier_evade_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 0 to level 1",
+ descname = pgettext("barbarians_building", "upgrading soldier evade from level 0 to level 1"),
actions = {
"check_soldier=soldier evade 0", -- Fails when aren't any soldier of level 0 evade
"sleep=15000",
@@ -100,7 +100,7 @@
},
upgrade_soldier_evade_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 1 to level 2",
+ descname = pgettext("barbarians_building", "upgrading soldier evade from level 1 to level 2"),
actions = {
"check_soldier=soldier evade 1", -- Fails when aren't any soldier of level 1 evade
"sleep=15000",
=== modified file 'data/tribes/buildings/trainingsites/barbarians/trainingcamp/init.lua'
--- data/tribes/buildings/trainingsites/barbarians/trainingcamp/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/barbarians/trainingcamp/init.lua 2017-02-10 09:46:19 +0000
@@ -107,7 +107,7 @@
},
upgrade_soldier_attack_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 0 to level 1",
+ descname = pgettext("barbarians_building", "upgrading soldier attack from level 0 to level 1"),
actions = {
"check_soldier=soldier attack 0", -- Fails when aren't any soldier of level 0 attack
"sleep=30000",
@@ -118,7 +118,7 @@
},
upgrade_soldier_attack_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 1 to level 2",
+ descname = pgettext("barbarians_building", "upgrading soldier attack from level 1 to level 2"),
actions = {
"check_soldier=soldier attack 1",
"sleep=30000",
@@ -129,7 +129,7 @@
},
upgrade_soldier_attack_2 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 2 to level 3",
+ descname = pgettext("barbarians_building", "upgrading soldier attack from level 2 to level 3"),
actions = {
"check_soldier=soldier attack 2",
"sleep=30000",
@@ -140,7 +140,7 @@
},
upgrade_soldier_attack_3 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 3 to level 4",
+ descname = pgettext("barbarians_building", "upgrading soldier attack from level 3 to level 4"),
actions = {
"check_soldier=soldier attack 3",
"sleep=30000",
@@ -151,7 +151,7 @@
},
upgrade_soldier_attack_4 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 4 to level 5",
+ descname = pgettext("barbarians_building", "upgrading soldier attack from level 4 to level 5"),
actions = {
"check_soldier=soldier attack 4",
"sleep=30000",
@@ -162,7 +162,7 @@
},
upgrade_soldier_health_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 0 to level 1",
+ descname = pgettext("barbarians_building", "upgrading soldier health from level 0 to level 1"),
actions = {
"check_soldier=soldier health 0",
"sleep=30000",
@@ -173,7 +173,7 @@
},
upgrade_soldier_health_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 1 to level 2",
+ descname = pgettext("barbarians_building", "upgrading soldier health from level 1 to level 2"),
actions = {
"check_soldier=soldier health 1",
"sleep=30000",
@@ -184,7 +184,7 @@
},
upgrade_soldier_health_2 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 2 to level 3",
+ descname = pgettext("barbarians_building", "upgrading soldier health from level 2 to level 3"),
actions = {
"check_soldier=soldier health 2",
"sleep=30000",
=== modified file 'data/tribes/buildings/trainingsites/empire/arena/init.lua'
--- data/tribes/buildings/trainingsites/empire/arena/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/empire/arena/init.lua 2017-02-10 09:46:19 +0000
@@ -78,7 +78,7 @@
},
upgrade_soldier_evade_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 0 to level 1",
+ descname = pgettext("empire_building", "upgrading soldier evade from level 0 to level 1"),
actions = {
"check_soldier=soldier evade 0", -- Fails when aren't any soldier of level 0 evade
"sleep=30000",
=== modified file 'data/tribes/buildings/trainingsites/empire/colosseum/init.lua'
--- data/tribes/buildings/trainingsites/empire/colosseum/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/empire/colosseum/init.lua 2017-02-10 09:46:19 +0000
@@ -73,7 +73,7 @@
},
upgrade_soldier_evade_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 0 to level 1",
+ descname = pgettext("empire_building", "upgrading soldier evade from level 0 to level 1"),
actions = {
"check_soldier=soldier evade 0", -- Fails when aren't any soldier of level 0 evade
"sleep=30000",
@@ -84,7 +84,7 @@
},
upgrade_soldier_evade_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier evade from level 1 to level 2",
+ descname = pgettext("empire_building", "upgrading soldier evade from level 1 to level 2"),
actions = {
"check_soldier=soldier evade 1", -- Fails when aren't any soldier of level 1 evade
"sleep=30000",
=== modified file 'data/tribes/buildings/trainingsites/empire/trainingcamp/init.lua'
--- data/tribes/buildings/trainingsites/empire/trainingcamp/init.lua 2016-09-03 14:59:10 +0000
+++ data/tribes/buildings/trainingsites/empire/trainingcamp/init.lua 2017-02-10 09:46:19 +0000
@@ -101,7 +101,7 @@
},
upgrade_soldier_attack_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 0 to level 1",
+ descname = pgettext("empire_building", "upgrading soldier attack from level 0 to level 1"),
actions = {
"check_soldier=soldier attack 0", -- Fails when aren't any soldier of level 0 attack
"sleep=30000",
@@ -112,7 +112,7 @@
},
upgrade_soldier_attack_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 1 to level 2",
+ descname = pgettext("empire_building", "upgrading soldier attack from level 1 to level 2"),
actions = {
"check_soldier=soldier attack 1",
"sleep=30000",
@@ -123,7 +123,7 @@
},
upgrade_soldier_attack_2 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 2 to level 3",
+ descname = pgettext("empire_building", "upgrading soldier attack from level 2 to level 3"),
actions = {
"check_soldier=soldier attack 2",
"sleep=30000",
@@ -134,7 +134,7 @@
},
upgrade_soldier_attack_3 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier attack from level 3 to level 4",
+ descname = pgettext("empire_building", "upgrading soldier attack from level 3 to level 4"),
actions = {
"check_soldier=soldier attack 3",
"sleep=30000",
@@ -145,7 +145,7 @@
},
upgrade_soldier_health_0 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 0 to level 1",
+ descname = pgettext("empire_building", "upgrading soldier health from level 0 to level 1"),
actions = {
"check_soldier=soldier health 0",
"sleep=30000",
@@ -156,7 +156,7 @@
},
upgrade_soldier_health_1 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 1 to level 2",
+ descname = pgettext("empire_building", "upgrading soldier health from level 1 to level 2"),
actions = {
"check_soldier=soldier health 1",
"sleep=30000",
@@ -167,7 +167,7 @@
},
upgrade_soldier_health_2 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 2 to level 3",
+ descname = pgettext("empire_building", "upgrading soldier health from level 2 to level 3"),
actions = {
"check_soldier=soldier health 2",
"sleep=30000",
@@ -178,7 +178,7 @@
},
upgrade_soldier_health_3 = {
-- TRANSLATORS: Completed/Skipped/Did not start upgrading ... because ...
- descname = _"upgrading soldier health from level 3 to level 4",
+ descname = pgettext("empire_building", "upgrading soldier health from level 3 to level 4"),
actions = {
"check_soldier=soldier health 3",
"sleep=30000",
=== modified file 'doc/sphinx/source/productionsite_program.rst'
--- doc/sphinx/source/productionsite_program.rst 2016-12-18 20:51:32 +0000
+++ doc/sphinx/source/productionsite_program.rst 2017-02-10 09:46:19 +0000
@@ -1,6 +1,79 @@
Productionsite Program Reference
================================
-Productionsites can have programs that will be executed by the game engine. Each productionsite must have a program named ``work``, which will be started automatically when the productionsite is created in the game, and then repeated until the productionsite is destroyed. Each program must be declared with ``program=<name>`` in the ``[global]`` section of the productionsite's definition. A program can call another program, which must have been declared earlier. A program is defined in the section that has the same name as the program (the order of program definitions does not matter). A program consists of a sequence of commands. A command is written as ``<type>=<parameters>``. The different command types and the parameters that they take are explained below.
+Productionsites can have programs that will be executed by the game engine. Each productionsite must have a program named ``work``, which will be started automatically when the productionsite is created in the game, and then repeated until the productionsite is destroyed.
+
+Programs are defined as Lua tables. Each program must be declared as a subtable in the productionsite's Lua table called ``programs`` and have a unique table key. The entries in a program's subtable are the translatable ``descname`` and the table of ``actions`` to execute, like this::
+
+ programs = {
+ work = {
+ -- TRANSLATORS: Completed/Skipped/Did not start working because ...
+ descname = _"working",
+ actions = {
+ <list of actions>
+ }
+ },
+ },
+
+The translations for ``descname`` can also be fetched by ``pgettext`` to disambiguate. We recommend that you do this whenever workers are referenced, or if your tribes have multiple wares with the same name::
+
+ programs = {
+ work = {
+ -- TRANSLATORS: Completed/Skipped/Did not start recruiting soldier because ...
+ descname = pgettext("atlanteans_building", "recruiting soldier"),
+ actions = {
+ <list of actions>
+ }
+ },
+ },
+
+A program can call another program, for example::
+
+ programs = {
+ work = {
+ -- TRANSLATORS: Completed/Skipped/Did not start working because ...
+ descname = _"working",
+ actions = {
+ "call=produce_ration",
+ "call=produce_snack",
+ "return=skipped"
+ }
+ },
+ produce_ration = {
+ -- TRANSLATORS: Completed/Skipped/Did not start preparing a ration because ...
+ descname = _"preparing a ration",
+ actions = {
+ <list of actions>
+ }
+ },
+ produce_snack = {
+ -- TRANSLATORS: Completed/Skipped/Did not start preparing a snack because ...
+ descname = _"preparing a snack",
+ actions = {
+ <list of actions>
+ }
+ },
+ },
+
+A program's actions consist of a sequence of commands. A command is written as ``<type>=<parameters>``::
+
+
+ produce_snack = {
+ -- TRANSLATORS: Completed/Skipped/Did not start preparing a snack because ...
+ descname = _"preparing a snack",
+ actions = {
+ "return=skipped unless economy needs snack",
+ "sleep=5000",
+ "consume=barbarians_bread fish,meat beer",
+ "play_sound=sound/barbarians/taverns inn 100",
+ "animate=working 22000",
+ "sleep=10000",
+ "produce=snack"
+ }
+ },
+
+
+The different command types and the parameters that they take are explained below.
+
Command Types
^^^^^^^^^^^^^
@@ -37,7 +110,7 @@
workers_condition ::= workers need_experience
economy_needs ::= needs ware_type
need_experience ::= need experience
-
+
Parameter semantics:
``return_value``
=== modified file 'src/logic/map_objects/tribes/productionsite.cc'
--- src/logic/map_objects/tribes/productionsite.cc 2017-01-28 14:53:28 +0000
+++ src/logic/map_objects/tribes/productionsite.cc 2017-02-10 09:46:19 +0000
@@ -178,9 +178,16 @@
throw wexception("this program has already been declared");
}
std::unique_ptr<LuaTable> program_table = items_table->get_table(program_name);
- programs_[program_name] = std::unique_ptr<ProductionProgram>(
- new ProductionProgram(program_name, _(program_table->get_string("descname")),
- program_table->get_table("actions"), egbase, this));
+
+ // Allow use of both gettext and pgettext. This way, we can have a lower workload on
+ // translators and disambiguate at the same time.
+ const std::string program_descname_unlocalized = program_table->get_string("descname");
+ std::string program_descname = _(program_descname_unlocalized);
+ if (program_descname == program_descname_unlocalized) {
+ program_descname = pgettext_expr(msgctxt.c_str(), program_descname_unlocalized.c_str());
+ }
+ programs_[program_name] = std::unique_ptr<ProductionProgram>(new ProductionProgram(
+ program_name, program_descname, program_table->get_table("actions"), egbase, this));
} catch (const std::exception& e) {
throw wexception("program %s: %s", program_name.c_str(), e.what());
}
Follow ups