← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1576280-help-textdomains into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1576280-help-textdomains into lp:widelands.

Commit message:
Fixed fetching of help translations.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1576280 in widelands: "Missing localization in help window"
  https://bugs.launchpad.net/widelands/+bug/1576280

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1576280-help-textdomains/+merge/293479

Textdomains in Lua don't stack...
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1576280-help-textdomains into lp:widelands.
=== modified file 'data/scripting/editor/editor_controls.lua'
--- data/scripting/editor/editor_controls.lua	2016-04-06 16:44:00 +0000
+++ data/scripting/editor/editor_controls.lua	2016-05-01 10:00:38 +0000
@@ -1,8 +1,12 @@
-set_textdomain("widelands_editor")
-
 include "scripting/formatting.lua"
 include "txts/help/common_helptexts.lua"
 
+local toggle_minimap_hotkey = help_toggle_minimap_hotkey()
+local toggle_building_spaces_hotkey = help_toggle_building_spaces_hotkey()
+local toggle_fullscreen_hotkey = help_toggle_fullscreen_hotkey()
+
+set_textdomain("widelands_editor")
+
 return {
    title = _"Controls",
    text =
@@ -15,8 +19,8 @@
             dl(help_format_hotkey("H"), _"Toggle main menu") ..
             -- TRANSLATORS: This is an access key combination. The hotkey is 't'
             dl(help_format_hotkey("T"), _"Toggle tools menu") ..
-            help_toggle_minimap_hotkey() ..
-            help_toggle_building_spaces_hotkey() ..
+            toggle_minimap_hotkey ..
+            toggle_building_spaces_hotkey ..
             -- TRANSLATORS: This is an access key combination. The hotkey is 'p'
             dl(help_format_hotkey("P"), _"Toggle player menu") ..
             -- TRANSLATORS: This is an access key combination. Localize, but do not change the key.
@@ -29,7 +33,7 @@
             dl(help_format_hotkey(pgettext("hotkey", "Ctrl + L")), _"Load map") ..
             -- TRANSLATORS: This is an access key combination. Localize, but do not change the key.
             dl(help_format_hotkey(pgettext("hotkey", "Ctrl + S")), _"Save map") ..
-            help_toggle_fullscreen_hotkey()
+            toggle_fullscreen_hotkey
          ) ..
 
          h2(_"Tools") ..

=== modified file 'data/scripting/editor/editor_introduction.lua'
--- data/scripting/editor/editor_introduction.lua	2016-04-02 08:09:19 +0000
+++ data/scripting/editor/editor_introduction.lua	2016-05-01 10:00:38 +0000
@@ -1,8 +1,10 @@
-set_textdomain("widelands_editor")
-
 include "scripting/formatting.lua"
 include "txts/help/common_helptexts.lua"
 
+local online_help = help_online_help()
+
+set_textdomain("widelands_editor")
+
 return {
    title = _"The Widelands Editor",
    text =
@@ -12,7 +14,7 @@
          p(_"This editor is intended for players who would like to design their own maps to use with Widelands.") ..
          p(_"As you can see, this editor is heavy work in progress and as the editor becomes better and better, this text will also get longer and more complete.") ..
 
-         help_online_help() ..
+         online_help ..
          p(_"The wiki also includes a short tutorial on how to build a map.")
       )
 }

=== modified file 'data/tribes/scripting/help/controls.lua'
--- data/tribes/scripting/help/controls.lua	2016-04-02 11:12:35 +0000
+++ data/tribes/scripting/help/controls.lua	2016-05-01 10:00:38 +0000
@@ -3,6 +3,12 @@
 include "scripting/formatting.lua"
 include "txts/help/common_helptexts.lua"
 
+local toggle_minimap_hotkey = help_toggle_minimap_hotkey()
+local toggle_building_spaces_hotkey = help_toggle_building_spaces_hotkey()
+local toggle_fullscreen_hotkey = help_toggle_fullscreen_hotkey()
+
+set_textdomain("tribes_encyclopedia")
+
 return {
    title = _"Controls",
    text =
@@ -35,8 +41,8 @@
                dl(help_format_hotkey("C"), _"Toggle census") ..
                -- TRANSLATORS: This is an access key combination. The hotkey is 's'
                dl(help_format_hotkey("S"), _"Toggle statistics") ..
-               help_toggle_minimap_hotkey() ..
-               help_toggle_building_spaces_hotkey() ..
+               toggle_minimap_hotkey ..
+               toggle_building_spaces_hotkey ..
                -- TRANSLATORS: This is an access key combination. The hotkey is 'o'
                dl(help_format_hotkey("O"), _"Toggle objectives") ..
                -- TRANSLATORS: This is an access key combination. The hotkey is 'n'
@@ -57,7 +63,7 @@
                dl(help_format_hotkey("."), _"Go to the next location") ..
                -- TRANSLATORS: This is an access key combination. Localize, but do not change the key.
                dl(help_format_hotkey(pgettext("hotkey", "Ctrl + F11")), _"Take a screenshot") ..
-               help_toggle_fullscreen_hotkey() ..
+               toggle_fullscreen_hotkey ..
                -- TRANSLATORS: This is an access key combination.
                dl(help_format_hotkey(pgettext("hotkey", "Ctrl + F10")), _"Quit the game immediately") ..
                -- TRANSLATORS: This is an access key combination.


Follow ups