This module will transliterate Uzbek 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:uz-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 tt={
="t",="T", ="r",="R", ="f",="F",
="yu",="Yu", ="sh",="Sh", ="h",="H", ="’",="’", ="n",="N",
="p",="P", ="y",="Y", ="l",="L", ="z",="Z", ="e",="E",
="g",="G", ="b",="B", ="u",="U", ="s",="S", ="x",="X",
="ch",="Ch", ="ya",="Ya",
="m",="M", ="o",="O", ="i",="I", ="yo",="Yo", ="j",="J",
="k",="K", ="d",="D", ="v",="V", ="a",="A",
="oʻ",="Oʻ", ="e",="E", ="q",="Q", ="gʻ",="Gʻ"
};
function export.tr(text, lang, sc)
text = mw.ustring.gsub(
text,
"(?)()",
function(a, e)
local iotated = {
= 'ye',
= 'Ye',
}
return a .. iotated
end
)
text:gsub("^Е",'Ye'):gsub("^е",'ye')
return (mw.ustring.gsub(text, '.', tt))
end
return export