Module:pine-translit: Difference between revisions

no edit summary
(Created page with "local export = {} local tt = {} -- from Teulgi to Tuġvut font tt["Latn"] = { ["-t"] = '_0', ["-"] = '_', -- Synthetic diphthongs ["uo"]='aa-', ["ay"]='aa--', -- Short vowels ["o"]='u-', ["e"]='i-', ["y"]='a-', ["ů"]='u--', -- Geminate vowels ["ả"]='aa', ["ủ"]='uu', ["ỏ"]='u-u-', ["ỉ"]='ii', ["ẻ"]='i-i-', ["ỷ"]='a-a-', -- m-series ["bm"]='pm', ["ṃṃ"]='m-m', ["ṃ"]='m-', -- n-series ["ng"]='N-', ["dn"]='t-n', ["tṇ"]='t-n-',...")
 
No edit summary
Line 66: Line 66:


function export.tr(text, lang, sc)
function export.tr(text, lang, sc)
sc = sc or "Latn"
text = mw.ustring.lower(text)
    return mw.ustring.gsub(mw.ustring.lower(text), '.', tt[sc])
for pat, repl in pairs(tt[sc]) do
        text = mw.ustring.gsub(text, pat, repl)
end
 
    return text
end
end


return export
return export