Ensure formspec escaping for translated strings

This commit is contained in:
Wuzzy
2016-08-06 17:23:46 +02:00
parent 534c7bd92c
commit c816666945
6 changed files with 63 additions and 56 deletions

View File

@ -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"),