This module will transliterate Manchu language text. It is also used to transliterate Sanskrit and Classical Tibetan.
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:mnc-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local twoChars = {
= "ts",
= "sy",
= "c'y",
= "jy"
}
local oneChar = {
= "a",
= "e",
= "i",
= "y",
= "o",
= "u",
= "ū",
= "n",
= "ng",
= "k",
= "g",
= "h",
= "b",
= "p",
= "s",
= "š",
= "t",
= "d",
= "l",
= "m",
= "c",
= "j",
= "y",
= "r",
= "f",
= "w",
= "k'",
= "g'",
= "h'",
= "ts'",
= "dz",
= "ž",
= "c'",
= "j",
= ",",
= ".",
= "-",
= "-",
= "",
= "",
= "",
= "",
= "'",
= "'"
}
function export.tr(text, lang, sc)
if sc ~= "mnc-Mong" then
return nil
end
for digraph, replacement in pairs(twoChars) do
text = string.gsub(text, digraph, replacement)
end
text = mw.ustring.gsub(text, ".", oneChar)
return text
end
return export