Module:kv-translit
- පහත දැක්වෙන උපදෙස්, Module:documentation/functions/translit මගින් ජනනය කොට ඇත. [සංස්කරණය කරන්න]
- ප්රයෝජනවත් සබැඳි: උප පිටු ලැයිස්තුව • සබැඳි • transclusions • testcases • sandbox
Language code in page name (kv
) not recognized.
local export = {}
local tab = {
["А"]="A", ["Б"]="B", ["В"]="V", ["Г"]="G", ["Д"]="D", ["Е"]="E", ["Ё"]="O", ["Ж"]="Ž", ["З"]="Z", ["И"]="I", ["І"]="I", ["Й"]="J",
["К"]="K", ["Л"]="L", ["М"]="M", ["Н"]="N", ["О"]="O", ["Ӧ"]="Ö", ["П"]="P", ["Р"]="R", ["С"]="S", ["Т"]="T", ["У"]="U", ["Ф"]="F",
["Х"]="X", ["Ц"]="C", ["Ч"]="Cʹ", ["Ш"]="Š", ["Щ"]="Šč", ["Ъ"]="", ["Ы"]="Y", ["Ь"]="", ["Э"]="E", ["Ю"]="U", ["Я"]="A",
['а']='a', ['б']='b', ['в']='v', ['г']='g', ['д']='d', ['е']='e', ['ё']='o', ['ж']='ž', ['з']='z', ['и']='i', ['і']='i', ['й']='j',
['к']='k', ['л']='l', ['м']='m', ['н']='n', ['о']='o', ['ӧ']='ö', ['п']='p', ['р']='r', ['с']='s', ['т']='t', ['у']='u', ['ф']='f',
['х']='x', ['ц']='c', ['ч']='cʹ', ['ш']='š', ['щ']='šč', ['ъ']='', ['ы']='y', ['ь']='', ['э']='e', ['ю']='u', ['я']='a', ['Ө']='Å',
['ө']='å', ['Ӱ']='Ü', ['ӱ']='ü',
}
function export.tr(text, lang, sc)
local language = lang
-- Ё needs converting if is decomposed
text = text:gsub("ё","ё"):gsub("Ё","Ё")
-- тш
text = mw.ustring.gsub(text, "Тш", "Č")
text = mw.ustring.gsub(text, "тш", "č")
-- soft consonants
text = mw.ustring.gsub(text, "([Дд])з", "%1zQ")
text = mw.ustring.gsub(text, "([ТДСЗЛНтдсзлн])([еёияюь])", "%1Q%2")
if lang ~= "kpv" then
text = mw.ustring.gsub(text, "([Рр])([еёияюь])", "%1Q%2")
end
-- soft vowels after a vowel or at the beginning of a word become j-
text = mw.ustring.gsub(text, "([АОÖӨУӰЫЕЯЁЮИIЕЪЬаоöөуӱыэяёюиiеъь%A][\204\129\204\128]?)([еёюя])", "%1j%2")
text = mw.ustring.gsub(text, "^([ЕЁЮЯ])", "J%1")
text = mw.ustring.gsub(text, "^([еёюя])", "j%1")
text = mw.ustring.gsub(text, "Q", "ʹ")
return (mw.ustring.gsub(text,'.',tab))
end
return export