Module:umu-translit
Appearance
- The following documentation is generated by Module:documentation/functions/translit. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate Munsee language text.
The module should preferably not be called directly from templates or other modules.
To use it from a template, use {{xlit}}
.
Within a module, use Module:languages#Language:transliterate.
For testcases, see Module:umu-translit/testcases.
Functions
[edit]tr(text, lang, sc)
- Transliterates a given piece of
text
written in the script specified by the codesc
, and language specified by the codelang
. - When the transliteration fails, returns
nil
.
local export = {}
local replacements = {
["aa"] = "ā", ["ee"] = "ē", ["ii"] = "ī", ["oo"] = "ō",
["ch"] = "č", ["sh"] = "š", ["zh"] = "ž"
}
function export.tr(text)
local output = text
-- Perform all replacements
for key, value in pairs(replacements) do
output = output:gsub(key, value)
end
return output
end
return export