SmallJoker
2023-01-11 86e083c40973d7c4d450546659571f964b4bfefa
technic_cnc/init.lua
@@ -10,7 +10,17 @@
if rawget(_G, "intllib") then
   technic_cnc.getter = intllib.Getter()
else
   technic_cnc.getter = 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
   -- Intllib copypasta: TODO replace with the client-side translation API
   technic_cnc.getter = 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"")
         end
         return "@"..o..n..c
      end)
   end
end
dofile(modpath.."/cnc.lua")