This module will transliterate text in the Hanifi Rohingya script. It is used to transliterate Rohingya.
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:Rohg-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 = require("Module:string/char")
local tt = {
-- consonants
="", ="b", ="t", ="th",
="j", ="ch", ="h", ="kh",
="f", ="p", ="d", ="dh",
="r", ="ç", ="z", ="s",
="c", ="k", ="g", ="l",
="m", ="n", ="w", ="u",
="y", ="i", ="ng", ="ny", ="v",
-- vowels
="a", ="i", ="u", ="e", ="o",
-- others
="", --only used after some ending consonants
="ñ", --nasalization
="", --ZWJ, might appear to adjust consonants
-- numerals
="0", ="1", ="2", ="3", ="4",
="5", ="6", ="7", ="8", ="9",
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, ".", tt)
-- tones and special mark
text = mw.ustring.gsub(text, "(.)𐴤", "%1́")
text = mw.ustring.gsub(text, "(.)𐴥", "%1́%1")
text = mw.ustring.gsub(text, "(.)𐴦", "%1%1́")
text = mw.ustring.gsub(text, "(.)𐴧", "%1%1")
return text
end
return export