Module:Localization

local ugsub = mw.ustring.gsub local usub = mw.ustring.sub

-- return { -- replace all tokens in source string with replacement replace = function(frame) local str = frame.args['str'] for token, replace in pairs(frame:getParent.args) do			local isReplacementArg = usub(token, 1, 1) == '$' if frame.args['calledFromModule'] ~= nil and frame.args['calledFromModule'] ~= '' then isReplacementArg = usub(token, 1, 2) == '__' token = '$' .. usub(token, 3) .. '$'			end if isReplacementArg then -- escape, to perform plain text replacement. see Module:String str = ugsub(str, (ugsub(token, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1")), (ugsub(replace, "%%", "%%%%" ))) -- to force return only 1 value. end end return str end,

}