From 98988b1636279e0bfd4d9fe8c23f19941b81d76f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 25 Apr 2020 14:31:01 +0200 Subject: [PATCH] Fix creative search not take transl. into account --- mods/HUD/mcl_inventory/creative.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 0b5f52b6b2..2e30d10203 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -94,9 +94,17 @@ local function set_inv_search(filter, player) local playername = player:get_player_name() local inv = minetest.get_inventory({type="detached", name="creative_"..playername}) local creative_list = {} + local lang = minetest.get_player_information(playername).lang_code for name,def in pairs(minetest.registered_items) do if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then - if string.find(string.lower(def.name), filter) or string.find(string.lower(def.description), filter) then + local name = string.lower(def.name) + local desc + if not lang then + desc = string.lower(def.description) + else + desc = string.lower(minetest.get_translated_string(lang, def.description)) + end + if string.find(name, filter) or string.find(desc, filter) then table.insert(creative_list, name) end end