local export = {}
local u = mw.ustring.char
local consonants = {
= 'h', = 'sh', = 'n', = 'r', = 'b',
= 'ḷ', = 'k', = '', = 'v', = 'm',
= 'f', = 'd', = 't', = 'l', = 'g',
= 'ñ', = 's', = 'ḍ', = 'z', = 'ṭ',
= 'y', = 'p', = 'j', = 'c', = 'ṇ',
= 'ṯ', = 'ḥ', = 'x', = 'ź', = 'ž',
= 'š', = 'ş', = 'ḋ', = 'ţ', = 'ẓ',
= 'ʿ', = 'ġ', = 'q', = 'w',
}
local diacritics = {
= 'a', = 'ā', = 'i', = 'ī', = 'u',
= 'ū', = 'e', = 'ē', = 'o', = 'ō', = '',
-- no diacritic
= 'a'
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(
text,
'()(?)',
function(c, d)
return consonants .. diacritics
end)
return text
end
return export