Module:lyti-translit
Jump to navigation
Jump to search
- The following documentation is located at Module:lyti-translit/doc.[edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
local tt = {
["А"]='A', ["а"]='a',
["Б"]='B', ["б"]='b',
["Гв"]='W', ["гв"]='w',
["Ђв"]='Dźw', ["ђв"]='dźw',
["Јв"]='Jw', ["јв"]='jw',
["Нв"]='Ngw', ["нв"]='ngw',
["Ћв"]='Ćw', ["ћв"]='ćw',
["В"]='G', ["в"]='v',
["Г"]='G', ["г"]='g',
["Д"]='D', ["д"]='d',
["Ђ"]='D', ["ђ"]='dź',
["Е"]='E', ["е"]='e',
["Ж"]='Ź', ["ж"]='ź',
["З"]='Z', ["з"]='z',
["И"]='I', ["и"]='i',
["Ј"]='J', ["ј"]='j',
["К"]='K', ["к"]='k',
["Л"]='L', ["л"]='l',
["Љ"]='Lj', ["љ"]='lj',
["М"]='M', ["м"]='m',
["Н"]='N', ["н"]='n',
["Њ"]='Nj', ["њ"]='nj',
["О"]='O', ["о"]='o',
["П"]='P', ["п"]='p',
["Р"]='R', ["р"]='r',
["С"]='S', ["с"]='s',
["Т"]='T', ["т"]='t',
["Ћ"]='Ć', ["ћ"]='ć',
["У"]='U', ["у"]='u',
["Ф"]='F', ["ф"]='f',
["Х"]='X', ["х"]='x',
["Ш"]='Ś', ["ш"]='ś',
["Ѣ"]='Ē', ["ѣ"]='ē',
};
function export.tr(text, lang, sc)
text = mw.ustring.toNFD(text)
for pat, repl in pairs(tt) do
text = mw.ustring.gsub(text, pat, repl)
end
text = mw.ustring.toNFD(text)
return mw.ustring.toNFC(text)
end
return export