Module:Narb-translit
Jump to navigation
Jump to search
- The following documentation is located at Module:Narb-translit/documentation. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module will transliterate text in the Old North Arabian script. It is used to transliterate Dadanitic, Dumaitic, Hasaitic, Hismaic, Safaitic, Taymanitic, and Thamudic.
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:Narb-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, returnsnil
.
local export = {}
local chars = {
["𐪏"] = "s³", ["𐪙"] = "ḏ", ["𐪍"] = "ẖ", ["𐪊"] = "s¹", ["𐪆"] = "s²",
["𐪛"] = "ṯ", ["𐪑"] = "ʾ", ["𐪒"] = "ʿ", ["𐪈"] = "b", ["𐪕"] = "d",
["𐪓"] = "ḍ", ["𐪐"] = "f", ["𐪔"] = "g", ["𐪖"] = "ġ", ["𐪀"] = "h",
["𐪂"] = "ḥ", ["𐪋"] = "k", ["𐪁"] = "l", ["𐪃"] = "m", ["𐪌"] = "n",
["𐪄"] = "q", ["𐪇"] = "r", ["𐪎"] = "ṣ", ["𐪉"] = "t", ["𐪗"] = "ṭ",
["𐪅"] = "w", ["𐪚"] = "y", ["𐪘"] = "z", ["𐪜"] = "ẓ",
}
function export.tr(text, lang, sc)
return (mw.ustring.gsub(text, '.', chars))
end
return export