+-- https://github.com/minetest/minetest/blob/53dd7819277c53954d1298dfffa5287c306db8d0/src/util/string.cpp#L777\r
+local function strip_translation_escapes(input)\r
+ local s = function(idx) return input:sub(idx, idx) end\r
+ local out = ""\r
+ local i = 1\r
+ while i <= #input do\r
+ if s(i) == "\027" then -- escape sequence\r
+ i = i + 1\r
+ if s(i) == "(" then -- enclosed\r
+ i = i + 1\r
+ while i <= #input and s(i) ~= ")" do\r
+ if s(i) == "\\" then\r
+ i = i + 2\r
+ else\r
+ i = i + 1\r
+ end\r
+ end\r
+ end\r
+ else\r
+ out = out .. s(i)\r
+ end\r
+ i = i + 1\r
+ end\r
+ --print(("%q -> %q"):format(input, out))\r
+ return out\r
+end\r
+\r