跳转到内容

模組:Rsk-translit

維基詞典,自由的多語言詞典

這個模組將轉寫潘諾尼亞盧森尼亞語的文字。 最好不要直接從模板或其他模組呼叫此模組;要從模板中使用它, 請使用{{xlit}}; 要從模組中使用它,請使用Module:languages#Language:transliterate

關於測試用例,請見Module:Rsk-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 = {
	["А"]='A', ["а"]='a', ["Б"]='B', ["б"]='b', ["В"]='V', ["в"]='v', ["Г"]='H', ["г"]='h', 
	["Ґ"]='G', ["ґ"]='g', ["Д"]='D', ["д"]='d', ["Е"]='E', ["е"]='e', ["Є"]='Je', ["є"]='je', 
	["Ж"]='Ž', ["ж"]='ž', ["З"]='Z', ["з"]='z', ["И"]='I', ["и"]='i', ["Ї"]='Ji', ["ї"]='ji', 
	["Й"]='J', ["й"]='j', ["К"]='K', ["к"]='k', ["Л"]='L', ["л"]='l', ["М"]='M', ["м"]='m', 
	["Н"]='N', ["н"]='n', ["О"]='O', ["о"]='o', ["П"]='P', ["п"]='p', ["Р"]='R', ["р"]='r', 
	["С"]='S', ["с"]='s', ["Т"]='T', ["т"]='t', ["У"]='U', ["у"]='u', ["Ф"]='F', ["ф"]='f', 
	["Х"]='X', ["х"]='x', ["Ц"]='C', ["ц"]='c', ["Ч"]='Č', ["ч"]='č', ["Ш"]='Š', ["ш"]='š', 
	["Щ"]='Šč', ["щ"]='šč', ["Ь"]='ʹ', ["ь"]='ʹ', ["Ю"]='Ju', ["ю"]='ju', ["Я"]='Ja', ["я"]='ja',
}

function export.tr(text, lang, sc)
	return (mw.ustring.gsub(text, '.', tt))
end

return export