Module:Elba-translit
Appearance
- The following documentation is generated by Module:documentation/functions/translit. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate text in the Elbasan script. It is used to transliterate Albanian.
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:Elba-translit/testcases.
Functions
[edit]tr(text, lang, sc)
- Transliterates a given piece of
text
written in the script specified by the codesc
, and language specified by the codelang
. - When the transliteration fails, returns
nil
.
local export = {}
local tt = {
["𐔀"] = "a", ["𐔁"] = "b", ["𐔂"] = "c", ["𐔃"] = "ç", ["𐔄"] = "d", ["𐔅"] = "nd",
["𐔆"] = "dh", ["𐔇"] = "e", ["𐔈"] = "ë", ["𐔉"] = "f", ["𐔊"] = "g", ["𐔋"] = "gj",
["𐔌"] = "h", ["𐔍"] = "i", ["𐔎"] = "j", ["𐔏"] = "k", ["𐔐"] = "l", ["𐔑"] = "ll",
["𐔒"] = "m", ["𐔓"] = "n", ["𐔔"] = "ñ", ["𐔕"] = "nj", ["𐔖"] = "o", ["𐔗"] = "p",
["𐔘"] = "q", ["𐔙"] = "r", ["𐔚"] = "rr", ["𐔛"] = "s", ["𐔜"] = "sh", ["𐔝"] = "t",
["𐔞"] = "th", ["𐔟"] = "u", ["𐔠"] = "v", ["𐔡"] = "x", ["𐔢"] = "y", ["𐔣"] = "z",
["𐔤"] = "zh", ["𐔥"] = "ɣ", ["𐔦"] = "ɣ²", ["𐔧"] = "ꭓ",
-- TODO: clarify when the two ghayns are used.
};
function export.tr(text, lang, sc)
return (mw.ustring.gsub(text, '[𐔀-𐔧]', tt))
end
return export