This module will transliterate Akkala Sami 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:sia-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 U = mw.ustring.char
local rsubn = mw.ustring.gsub
local macron = U(0x0304)
local tt = {
='A', ='a',
="Ä", ="ä",
="Å", ="å",
='B', ='b',
='V', ='v',
='W', ='w',
='G', ='g',
='D', ='d',
='Je', ='je',
="Jo", ="jo",
='Ž', ='ž',
='Z', ='z',
="H", ="h", ="h",
='I', ='i',
="Ī", ="ī",
="J", ="j",
="J̥", ="j̥", ="J̥", ="j̥",
='K', ='k',
='Ǩ', ='ǩ',
='L', ='l',
='M', ='m',
='N', ='n',
="N̥", ="n̥",
="Ŋ", ="ŋ",
='O', ='o',
='P', ='p',
='R', ='r',
='S', ='s',
='T', ='t',
='U', ='u',
="Ū", ="ū",
='F', ='f',
='X', ='x',
='C', ='c',
='Č', ='č',
='Š', ='š',
="Šč", ="šč",
="Y", ="y",
="Ï", ="ï",
="", ="",
="’", ="’", = "’", ="’",
="E", ="e",
="’E", ="’e",
="Ju", ="ju",
="Ja", ="ja",
}
local vowel = "аӓеёиӣоуӯыӹэӭюяАӒЕЁИӢОУӮЫӸЭӬЮЯ"
function export.tr(text, lang, sc)
text = rsubn(text, "^" .. "я" .. macron, "jā")
text = rsubn(text, "^" .. "е" .. macron, "jē")
text = rsubn(text, "^" .. "Я" .. macron, "Jā")
text = rsubn(text, "^" .. "Е" .. macron, "Jē")
text = rsubn(text, " " .. "я" .. macron, " jā")
text = rsubn(text, " " .. "e" .. macron, " jē")
text = rsubn(text, " " .. "Я" .. macron, " jā")
text = rsubn(text, " " .. "E" .. macron, " jē")
text = rsubn(text, "()е", "%1ьэ")
text = rsubn(text, "()ё", "%1ьо")
text = rsubn(text, "()ю", "%1ьу")
text = rsubn(text, "()я", "%1ьа")
text = rsubn(text, "()Е", "%1ЬЭ")
text = rsubn(text, "()Ё", "%1ЬО")
text = rsubn(text, "()Ю", "%1ЬУ")
text = rsubn(text, "()Я", "%1ЬА")
text = rsubn(text, "()ь", "%1й")
text = rsubn(text, "НЬ", "НЙ")
text = rsubn(text, "()ҍ", "%1й")
text = rsubn(text, "Лҍ", "ЛЙ")
text = rsubn(text, '.', tt)
return text
end
return export