This module will transliterate Burmese language text per the MLCTS scheme per WT:MY TR.
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:my-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 gsub = mw.ustring.gsub
local symbols = {
= "0", = "1", = "2", = "3", = "4",
= "5", = "6", = "7", = "8", = "9",
= "|", = "||"
}
function export.tr(text, lang, sc)
local m_pron = require("Module:my-pron").get_romanisation
text = gsub(text, ".", symbols)
for word in mw.ustring.gmatch(text, "+") do
local success, translit = pcall(m_pron, word, nil, { 2, = "orthographic", = "MLCTS" }, 2, "translit_module")
if success then
text = gsub(text, word, translit, 1)
else
return nil
end
end
return text
end
return export