This module will transliterate Tuvan language text per WT:TYV 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:tyv-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 tab = {
="A", ="B", ="V", ="G", ="D", ="E", ="Yo", ="J", ="Z", ="İ", ="Y",
="K", ="L", ="M", ="N", ="Ñ", ="O", ="Ö", ="P", ="R", ="S", ="T",
="U", ="Ü", ="F", ="X", ="Ts", ="Ç", ="Ş", ="Şş", ="ʺ", ="I", ="ʹ",
="E", ="Yu", ="Ya",
='a', ='b', ='v', ='g', ='d', ='e', ='yo', ='j', ='z', ='i', ='y',
='k', ='l', ='m', ='n', ='ñ', ='o', ='ö', ='p', ='r', ='s', ='t',
='u', ='ü', ='f',
='x', ='ts', ='ç', ='ş', ='şş', ='ʺ', ='ı', ='ʹ', ='e', ='yu', ='ya',
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, 'Аъ', 'À')
text = mw.ustring.gsub(text, 'аъ', 'à')
text = mw.ustring.gsub(text, 'Эъ', 'È')
text = mw.ustring.gsub(text, 'эъ', 'è')
text = mw.ustring.gsub(text, 'Оъ', 'Ò')
text = mw.ustring.gsub(text, 'оъ', 'ò')
text = mw.ustring.gsub(text, 'Үъ', 'Ǜ')
text = mw.ustring.gsub(text, 'үъ', 'ǜ')
text = mw.ustring.gsub(text, 'Уъ', 'Ỳ')
text = mw.ustring.gsub(text, 'уъ', 'ỳ')
text = mw.ustring.gsub(text, 'Иъ', 'İ̀')
text = mw.ustring.gsub(text, 'иъ', 'i̇̀')
text = mw.ustring.gsub(text, 'Ыъ', 'Ì')
text = mw.ustring.gsub(text, 'ыъ', 'ì')
text = mw.ustring.gsub(text, 'Өъ', 'Ö̀')
text = mw.ustring.gsub(text, 'өъ', 'ö̀')
-- Ё needs converting if is decomposed
text = text:gsub("ё","ё"):gsub("Ё","Ё")
return (mw.ustring.gsub(text,'.',tab))
end
return export