Module:dzhk-translit
- The following documentation is generated by Module:documentation/functions/translit. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate Dženubiskă language 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:dzhk-translit/testcases.
Functions
tr(text, lang, sc)- Transliterates a given piece of
textwritten in the script specified by the codesc, and language specified by the codelang. - When the transliteration fails, returns
nil.
local export = {}
local tt = {
["А"]='A', ["а"]='a', ["Б"]='B', ["б"]='b', ["В"]='V', ["в"]='v', ["Г"]='G', ["г"]='g', ["Д"]='D', ["д"]='d',
["Е"]='E', ["е"]='e', ["Ж"]='Ž', ["ж"]='ž', ["З"]='Z', ["з"]='z', ["И"]='I', ["и"]='i', ["К"]='K', ["к"]='k',
["Л"]='L', ["л"]='l', ["М"]='M', ["м"]='m', ["Н"]='N', ["н"]='n', ["О"]='O', ["о"]='o', ["П"]='P', ["п"]='p',
["Р"]='R', ["р"]='r', ["С"]='S', ["с"]='s', ["Т"]='T', ["т"]='t', ["У"]='U', ["у"]='u', ["Ф"]='F', ["ф"]='f',
["Х"]='H', ["х"]='h', ["Ч"]='Č', ["ч"]='č', ["Ш"]='Š', ["ш"]='š', ["Ъ"]='Ă', ["ъ"]='ă', ["Ь"]='J', ["ь"]='j',
["Ю"]='Ju', ["ю"]='ju', ["Я"]='Ja', ["я"]='ja', ["Й"]='J', ["й"]='j',
};
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, '.', tt)
return text
end
return export