From 8dea715303a2d800ff638716c62436a86177b30f Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 17 Mar 2017 10:05:42 +0000 Subject: code tidy and intllib update --- init.lua | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index bf526e1..09c10d6 100644 --- a/init.lua +++ b/init.lua @@ -23,20 +23,12 @@ local S if minetest.get_modpath("intllib") then S = intllib.Getter() else - S = function(s, a, ...) - if a == nil then - return s - end - a = {a, ...} - return s:gsub("(@?)@(%(?)(%d+)(%)?)", - function(e, o, n, c) - if e == ""then - return a[tonumber(n)] .. (o == "" and c or "") - else - return "@" .. o .. n .. c - end - end) - end + S = function(s, a, ...) a = {a, ...} + return s:gsub("@(%d+)", function(n) + return a[tonumber(n)] + end) + end + end protector.intllib = S -- cgit v1.2.3