From c81666694587dc49936eb2122607de1efd1589fd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 6 Aug 2016 17:23:46 +0200 Subject: Ensure formspec escaping for translated strings --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'init.lua') 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"), -- cgit v1.2.3