Jump to content

Module:kk-translit

Wiktionary වෙතින්

This module will transliterate Kazakh භාෂාව text. 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:kk-translit/testcases.

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.

local export = {}

local tt = {
["ү"]="ü"
,["Ү"]="Ü"
,["т"]="t"
,["Т"]="T"
,["һ"]="h"
,["Һ"]="H"
,["р"]="r"
,["Р"]="R"
,["ф"]="f"
,["Ф"]="F"
,["ш"]="ş"
,["Ш"]="Ş"
,["н"]="n"
,["Н"]="N"
,["п"]="p"
,["П"]="P"
,["й"]="i"
,["Й"]="İ"
,["л"]="l"
,["Л"]="L"
,["з"]="z"
,["З"]="Z"
,["е"]="e"
,["Е"]="E"
,["г"]="g"
,["Г"]="G"
,["б"]="b"
,["Б"]="B"
,["у"]="u"
,["У"]="U"
,["с"]="s"
,["С"]="S"
,["х"]="x"
,["Х"]="X"
,["ы"]="y"
,["Ы"]="Y"
,["м"]="m"
,["М"]="M"
,["о"]="o"
,["О"]="O"
,["и"]="i"
,["И"]="I"
,["ж"]="j"
,["Ж"]="J"
,["к"]="k"
,["К"]="K"
,["д"]="d"
,["Д"]="D"
,["в"]="v"
,["В"]="V"
,["а"]="a"
,["А"]="A"
,["ң"]="ñ"
,["Ң"]="Ñ"
,["ә"]="ä"
,["Ә"]="Ä"
,["э"]="é"
,["Э"]="É"
,["ұ"]="ū"
,["Ұ"]="Ū"
,["қ"]="q"
,["Қ"]="Q"
,["ғ"]="ğ"
,["Ғ"]="Ğ"
,["і"]="ı"
,["І"]="ı"--?
,["ө"]="ö"
,["Ө"]="Ö"

--mostly in loanwords from Russian
,["ё"]="e"
,["Ё"]="E"
,["ц"]="s"
,["Ц"]="S"
,["ч"]="ç"
,["Ч"]="Ç"
,["щ"]="şş"
,["Щ"]="Şş"
,["ъ"]=""
,["Ъ"]=""
,["ь"]=""
,["Ь"]=""
,["э"]="e"
,["Э"]="E"
,["ю"]="ü"
,["Ю"]="Ü"
,["я"]="ä"
,["Я"]="Ä"
--хостинг - hostiñ
,["нг"]="ñ"
,["Нг"]="Ñ"
--is it used?
,["ӯ"]="u"
,["Ӯ"]="U"
};

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

return export
"https://si.wiktionary.org/w/index.php?title=Module:kk-translit&oldid=27265" වෙතින් සම්ප්‍රවේශනය කෙරිණි