aboutsummaryrefslogtreecommitdiff
path: root/signs/common.lua
diff options
context:
space:
mode:
authorpyrollo <dev@pyrollo.com>2017-08-26 10:22:54 +0200
committerGitHub <noreply@github.com>2017-08-26 10:22:54 +0200
commitd59c475162da02695a85ebd92a44e53129aa8be3 (patch)
treeb72e4a139bd574119c2d67f93354178557642237 /signs/common.lua
parente29f085c32caa485ce407b574641bd5f0a492820 (diff)
parent2fef15d878f00c72a799aebc5b8a6bd61489296e (diff)
downloaddisplay_modpack-d59c475162da02695a85ebd92a44e53129aa8be3.tar.gz
display_modpack-d59c475162da02695a85ebd92a44e53129aa8be3.tar.bz2
display_modpack-d59c475162da02695a85ebd92a44e53129aa8be3.zip
Merge pull request #6 from fat115/master
add intllib support (i18n)
Diffstat (limited to 'signs/common.lua')
-rw-r--r--signs/common.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/signs/common.lua b/signs/common.lua
index 08dd4b8..7771d49 100644
--- a/signs/common.lua
+++ b/signs/common.lua
@@ -18,6 +18,9 @@
along with signs. If not, see <http://www.gnu.org/licenses/>.
--]]
+local S = signs.intllib
+local F = function(...) return minetest.formspec_escape(S(...)) end
+
function signs.set_formspec(pos)
local meta = minetest.get_meta(pos)
local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
@@ -27,17 +30,17 @@ function signs.set_formspec(pos)
if maxlines == 1 then
formspec = "size[6,3]"..
- "field[0.5,0.7;5.5,1;display_text;Displayed text;${display_text}]"..
- "button_exit[2,2;2,1;ok;Write]"
+ "field[0.5,0.7;5.5,1;display_text;"..F("Displayed text")..";${display_text}]"..
+ "button_exit[2,2;2,1;ok;"..F("Write").."]"
else
local extralabel = ""
if maxlines then
- extralabel = " (first "..maxlines.." lines only)"
+ extralabel = F(" (first %s lines only)"):format(maxlines)
end
formspec = "size[6,4]"..
- "textarea[0.5,0.7;5.5,2;display_text;Displayed text"..extralabel..";${display_text}]"..
- "button_exit[2,3;2,1;ok;Write]"
+ "textarea[0.5,0.7;5.5,2;display_text;"..F("Displayed text")..""..extralabel..";${display_text}]"..
+ "button_exit[2,3;2,1;ok;"..F("Write").."]"
end
meta:set_string("formspec", formspec)