This module will transliterate Urum language text per WT:UUM TR.
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:uum-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local tab =
{ ="A" , ="B", ="V", ="G", ="D", ="E", ="Ž", ="Z", ="I", ="J",
="K", ="L", ="M", ="N", ="O", ="Ö", ="P", ="R", ="S", ="T",
="U", ="Ü", ="F", ="H", ="Č", ="Š", ="Ǧ", ="Y", ="E",
='a', ='b', ='v', ='g', ='d', ='e', ='ž', ='z', ='i', ='j',
='k', ='l', ='m', ='n', ='o', ='ö', ='p', ='r', ='s', ='t',
='u', ='ü', ='f', ='h', ='č', ='š', ='ǧ', ='y', ='e',
= 'dž' , = 'Dž',
}
local iotated = {
= "Je",
= "je",
}
function export.tr(text, lang, sc)
local ugsub = mw.ustring.gsub
-- е after a vowel or at the beginning of a word becomes je
text = ugsub(text, "(?)е", "%1je")
--text = mw.ustring.gsub(text, "(?)е", "%1je")
text = ugsub(text, "^", iotated)
text = ugsub(text, "()()", function(a, b)
return a .. iotated
end)
return (ugsub(text, '.', tab))
end
return export