Module:mnc-translit: Difference between revisions
Jump to navigation
Jump to search
Created page with "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..." |
m 1 revision imported |
||
| (One intermediate revision by one other user not shown) | |||
| Line 51: | Line 51: | ||
["᠍"] = "", | ["᠍"] = "", | ||
["᠏"] = "", | ["᠏"] = "", | ||
[""] = "'" | [""] = "'", | ||
["᠇"] = "'" | |||
} | } | ||
Latest revision as of 12:44, 21 April 2026
Documentation for this module may be created at Module:mnc-translit/doc
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