aboutsummaryrefslogtreecommitdiff
path: root/signs/common.lua
diff options
context:
space:
mode:
authorfat115 <fat115@framasoft.org>2017-08-05 10:12:43 +0200
committerfat115 <fat115@framasoft.org>2017-08-05 10:12:43 +0200
commit2fef15d878f00c72a799aebc5b8a6bd61489296e (patch)
tree5d5ec63f18bb317fa7c56dcb00c8ffa7f3a62b10 /signs/common.lua
parent54108e8054ee21e1a3b229f4a4e9e521f5700aa6 (diff)
downloaddisplay_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.tar.gz
display_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.tar.bz2
display_modpack-2fef15d878f00c72a799aebc5b8a6bd61489296e.zip
add intllib support (i18n)
-> mods ontime_clocks, signs, signs_roads & steles add french translations add updatepo.sh script to update po/pot files add specific array for full description of steles
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)