45,646
edits
No edit summary |
No edit summary |
||
Line 391: | Line 391: | ||
function Language:transliterate(text, sc, module_override) | function Language:transliterate(text, sc, module_override) | ||
if not ((module_override or | local m = self._rawData.translit_module | ||
if not ((module_override or m) and text) then | |||
return nil | return nil | ||
end | end | ||
return require("Module:" .. (module_override or | return require((mw.ustring.match(m, "$w:") and "w:" or "") .. "Module:" | ||
.. (module_override or (mw.ustring.match(m, "$w:") and mw.ustring.sub(m, 3) or m))).tr(text, self:getCode(), sc and sc:getCode() or nil) | |||
end | end | ||