summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-06 17:23:46 +0200
committerWuzzy <almikes@aol.com>2016-08-06 17:23:46 +0200
commitc81666694587dc49936eb2122607de1efd1589fd (patch)
tree4d78acae78e081f30b8aa8d1076a1ecf5a27175f /init.lua
parent534c7bd92c663e08f96523e1c352f0b851622cc7 (diff)
Ensure formspec escaping for translated strings
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index d311ace..e24fff2 100644
--- a/init.lua
+++ b/init.lua
@@ -2,6 +2,7 @@
local modpath = minetest.get_modpath(minetest.get_current_modname())
local worldpath = minetest.get_worldpath()
+local mygettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
-- Data tables definitions
unified_inventory = {
@@ -31,7 +32,8 @@ unified_inventory = {
default = "craft",
-- intllib
- gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
+ gettext = mygettext,
+ fgettext = function(s) return minetest.formspec_escape(mygettext(s)) end,
-- "Lite" mode
lite_mode = minetest.setting_getbool("unified_inventory_lite"),