From 0cc038c5452d972e76c1f9179edc37f25b972dc9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 7 Mar 2019 21:14:30 +0100 Subject: [PATCH] New translation system, part 4: Misc/Player --- mods/MISC/mcl_commands/init.lua | 7 +------ mods/MISC/mcl_privs/init.lua | 4 +++- mods/MISC/mcl_wip/init.lua | 6 ++++-- mods/PLAYER/mcl_skins/init.lua | 5 +---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mods/MISC/mcl_commands/init.lua b/mods/MISC/mcl_commands/init.lua index b7ce1e1cd8..50dd052648 100644 --- a/mods/MISC/mcl_commands/init.lua +++ b/mods/MISC/mcl_commands/init.lua @@ -1,11 +1,6 @@ local minecraftaliases = true -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end -end +local S = minetest.get_translator("mcl_commands") local function handle_kill_command(suspect, victim) if minetest.settings:get_bool("enable_damage") == false then diff --git a/mods/MISC/mcl_privs/init.lua b/mods/MISC/mcl_privs/init.lua index c242ed3de2..00670db1c4 100644 --- a/mods/MISC/mcl_privs/init.lua +++ b/mods/MISC/mcl_privs/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mcl_privs") + minetest.register_privilege("maphack", { - description = "Can place and use advanced blocks like mob spawners, command blocks and barriers.", + description = S("Can place and use advanced blocks like mob spawners, command blocks and barriers."), }) diff --git a/mods/MISC/mcl_wip/init.lua b/mods/MISC/mcl_wip/init.lua index 8f9d206b84..640cc3766a 100644 --- a/mods/MISC/mcl_wip/init.lua +++ b/mods/MISC/mcl_wip/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mcl_wip") + local wip_items = { "mcl_fishing:fishing_rod", "mcl_maps:empty_map", @@ -27,7 +29,7 @@ for i=1,#wip_items do if new_description == "" then new_description = wip_items[i] end - new_description = new_description .. "\n"..core.colorize("#FF0000", "(WIP)") + new_description = new_description .. "\n"..core.colorize("#FF0000", S("(WIP)")) new_groups.not_in_craft_guide = 1 minetest.override_item(wip_items[i], { description = new_description, groups = new_groups }) end @@ -39,7 +41,7 @@ for i=1,#experimental_items do break end local new_description = def.description - new_description = new_description .. "\n"..core.colorize("#FFFF00", "(Temporary)") + new_description = new_description .. "\n"..core.colorize("#FFFF00", S("(Temporary)")) minetest.override_item(experimental_items[i], { description = new_description }) end diff --git a/mods/PLAYER/mcl_skins/init.lua b/mods/PLAYER/mcl_skins/init.lua index 25dd17acb9..fac543e3c2 100644 --- a/mods/PLAYER/mcl_skins/init.lua +++ b/mods/PLAYER/mcl_skins/init.lua @@ -6,10 +6,7 @@ mcl_skins = { skin_count = 0, -- counter of _custom_ skins (all skins except character.png) } - --- Load support for intllib. -local S, NS = dofile(mcl_skins.modpath .. "/intllib.lua") - +local S = minetest.get_translator("mcl_skins") -- load skin list and metadata local id, f, data, skin = 0