diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-03-17 10:05:42 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-03-17 10:05:42 +0000 |
commit | 8dea715303a2d800ff638716c62436a86177b30f (patch) | |
tree | a2b07bd8bcf49e07a11bd38384fd4a1c09259729 /init.lua | |
parent | 3b5e728b7dcf7eefd2010c91413473a545725adc (diff) |
code tidy and intllib update
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -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 |