Module:User:Surjection/kk-2018-translit

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This module is a modified version of Module:kk-translit that uses the new official 2018 Kazakh Latin alphabet instead of an older system. Despite this, the module takes some artistic liberties in transliterating characters, the romanizations of which have not described in the official alphabet (at least that I could find).


local export = {}

local tt = {
	["ү"]="ú",['Ү']='Ú',   ["т"]="t",['Т']='T', ["һ"]="h",['Һ']='H', ["р"]="r",['Р']='R',   ["ф"]="f",['Ф']='F',
	["ю"]="ıý",['Ю']='Iý', ["ш"]="sh",['Ш']='Sh', ["ь"]="ʹ",['Ь']='ʹ',   ["ъ"]="ʺ",['Ъ']='ʺ', ["н"]="n",['Н']='N', 
	["п"]="p",['П']='P',   ["й"]="ı",['Й']='I', ["л"]="l",['Л']='L',   ["з"]="z",['З']='Z', ["е"]="e",['Е']='E', 
	["г"]="g",['Г']='G',   ["б"]="b",['Б']='B', ["у"]="ý",['У']='Ý',   ["с"]="s",['С']='S', ["х"]="h",['Х']='H',
	["ч"]="ch",['Ч']='Ch', ["щ"]="shsh",['Щ']='Shsh', ["я"]="ıa",['Я']='Ia', ["ы"]="y",['Ы']='Y', ["э"]="e",['Э']='E', 
	["м"]="m",['М']='M',   ["о"]="o",['О']='O', ["и"]="ı",['И']='I', ["ё"]="ıo",['Ё']='Io', ["ж"]="j",['Ж']='J',
	["к"]="k",['К']='K',   ["д"]="d",['Д']='D', ["в"]="v",['В']='V', ["ц"]="ts",['Ц']='Ts', ["а"]="a",['А']='A',
	["ң"]="ń",['Ң']='Ń',   ["ә"]="á",['Ә']='Á', ["э"]="é",['Э']='É', ["ұ"]="u",['Ұ']='U', ["қ"]="q",['Қ']="Q",
	["ғ"]="ǵ",['Ғ']='Ǵ',   ["і"]="i",['І']='I', ["ө"]="ó",['Ө']='Ó', ["ӯ"]="ý",['Ӯ']='Ý'
};

function export.tr(text, lang, sc)
	if sc == "Cyrl" then
		return (mw.ustring.gsub(text, '.', tt))
	end
end

return export