Modul:be-translit

Vun Wiktionary

This module will transliterate Belarusian text per WT:BE TR through the function tr.


--[[
Transliteration for Belarusian.
]]
local M={}
 
local tt={
    ["А"]='A', ["а"]='a', ["Б"]='B', ["б"]='b', ["В"]='V', ["в"]='v', ["Г"]='H', ["г"]='h', ["Д"]='D', ["д"]='d', 
    ["Е"]='Je', ["е"]='je', ["Ё"]='Jó', ["ё"]='jó', ["Ж"]='Ž', ["ж"]='ž', ["З"]='Z', ["з"]='z', ["І"]='I', ["і"]='i', 
    ["Й"]='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', 
    ["Ч"]='Č', ["ч"]='č', ["Ш"]='Š', ["ш"]='š', ["Ы"]='Y', ["ы"]='y', ["Ь"]='ʹ', ["ь"]='ʹ', ["Э"]='E', ["э"]='e', 
    ["Ю"]='Ju', ["ю"]='ju', ["Я"]='Ja', ["я"]='ja', 
    ["’"]='ʺ', ["'"]='ʺ', ["ʼ"]='ʺ'
};
function M.tr(text)--translit any words or phrases
    if type(text) == "table" then text = text.args[1] end
 
    return (mw.ustring.gsub(text, '.', tt))
end
return M