Module:I18n

local p = {}

local utilsString = require("Module:UtilsString") local utilsTable = require("Module:UtilsTable")

local strings = {}

function p.loadStrings(tbl) strings = utilsTable.merge({}, strings, tbl) end

function p.getString(path, vars) local code = mw.getContentLanguage:getCode local localeStrings = strings[code] local subkeys = mw.text.split(path, "%.") local result = localeStrings for _, subkey in ipairs(subkeys) do		result = result[subkey] end return utilsString.interpolate(result, vars) end

return p