From f7250e5bec9069c4bc0ae522d0981a133d773428 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Tue, 15 Oct 2019 11:30:38 +0300 Subject: [PATCH] Remove translation strings when cleansing node descriptions --- fluid_lib/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fluid_lib/init.lua b/fluid_lib/init.lua index c2c57a1..e8ccf02 100644 --- a/fluid_lib/init.lua +++ b/fluid_lib/init.lua @@ -32,7 +32,12 @@ function fluid_lib.cleanse_node_description(node) local ndef = minetest.registered_nodes[node] if not ndef then return nil end - local no_source = ndef.description:gsub("(%s?Source%s?)", "") + local desc_no_translation = ndef.description + if string.match(desc_no_translation, "^\27") ~= nil then + desc_no_translation = desc_no_translation:match("[)]([%w%s]+)\27") + end + + local no_source = desc_no_translation:gsub("(%s?Source%s?)", "") fluid_lib.fluid_description_cache[node] = no_source return no_source