This module will transliterate Makasar 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:mak-Latn-Bugi-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 = {}
tt = {
="ᨀ", ="ᨀᨗ", ="ᨀᨘ", ="ᨀᨙ", ="ᨀᨚ",
="ᨁ", ="ᨁᨗ", ="ᨁᨘ", ="ᨁᨙ", ="ᨁᨚ",
="ᨄ", ="ᨄᨗ", ="ᨄᨘ", ="ᨄᨙ", ="ᨄᨚ",
="ᨅ", ="ᨅᨗ", ="ᨅᨘ", ="ᨅᨙ", ="ᨅᨚ",
="ᨆ", ="ᨆᨗ", ="ᨆᨘ", ="ᨆᨙ", ="ᨆᨚ",
="ᨈ", ="ᨈᨗ", ="ᨈᨘ", ="ᨈᨙ", ="ᨈᨚ",
="ᨉ", ="ᨉᨗ", ="ᨉᨘ", ="ᨉᨙ", ="ᨉᨚ",
="ᨊ", ="ᨊᨗ", ="ᨊᨘ", ="ᨊᨙ", ="ᨊᨚ",
="ᨌ", ="ᨌᨗ", ="ᨌᨘ", ="ᨌᨙ", ="ᨌᨚ",
="ᨍ", ="ᨍᨗ", ="ᨍᨘ", ="ᨍᨙ", ="ᨍᨚ",
="ᨐ", ="ᨐᨗ", ="ᨐᨘ", ="ᨐᨙ", ="ᨐᨚ",
="ᨑ", ="ᨑᨗ", ="ᨑᨘ", ="ᨑᨙ", ="ᨑᨚ",
="ᨒ", ="ᨒᨗ", ="ᨒᨘ", ="ᨒᨙ", ="ᨒᨚ",
="ᨓ", ="ᨓᨗ", ="ᨓᨘ", ="ᨓᨙ", ="ᨓᨚ",
="ᨔ", ="ᨔᨗ", ="ᨔᨘ", ="ᨔᨙ", ="ᨔᨚ",
="ᨖ", ="ᨖᨗ", ="ᨖᨘ", ="ᨖᨙ", ="ᨖᨚ",
="ᨕ", ="ᨕᨗ", ="ᨕᨘ", ="ᨕᨙ", ="ᨕᨚ",
="ᨂ", ="ᨂᨗ", ="ᨂᨘ", ="ᨂᨙ", ="ᨂᨚ",
="ᨎ", ="ᨎᨗ", ="ᨎᨘ", ="ᨎᨙ", ="ᨎᨚ",
="ᨀ", ="ᨀᨗ", ="ᨀᨘ", ="ᨀᨙ", ="ᨀᨚ",
="ᨁ", ="ᨁᨗ", ="ᨁᨘ", ="ᨁᨙ", ="ᨁᨚ",
="ᨄ", ="ᨄᨗ", ="ᨄᨘ", ="ᨄᨙ", ="ᨄᨚ",
="ᨅ", ="ᨅᨗ", ="ᨅᨘ", ="ᨅᨙ", ="ᨅᨚ",
="ᨆ", ="ᨆᨗ", ="ᨆᨘ", ="ᨆᨙ", ="ᨆᨚ",
="ᨈ", ="ᨈᨗ", ="ᨈᨘ", ="ᨈᨙ", ="ᨈᨚ",
="ᨉ", ="ᨉᨗ", ="ᨉᨘ", ="ᨉᨙ", ="ᨉᨚ",
="ᨊ", ="ᨊᨗ", ="ᨊᨘ", ="ᨊᨙ", ="ᨊᨚ",
="ᨌ", ="ᨌᨗ", ="ᨌᨘ", ="ᨌᨙ", ="ᨌᨚ",
="ᨍ", ="ᨍᨗ", ="ᨍᨘ", ="ᨍᨙ", ="ᨍᨚ",
="ᨐ", ="ᨐᨗ", ="ᨐᨘ", ="ᨐᨙ", ="ᨐᨚ",
="ᨑ", ="ᨑᨗ", ="ᨑᨘ", ="ᨑᨙ", ="ᨑᨚ",
="ᨒ", ="ᨒᨗ", ="ᨒᨘ", ="ᨒᨙ", ="ᨒᨚ",
="ᨓ", ="ᨓᨗ", ="ᨓᨘ", ="ᨓᨙ", ="ᨓᨚ",
="ᨔ", ="ᨔᨗ", ="ᨔᨘ", ="ᨔᨙ", ="ᨔᨚ",
="ᨖ", ="ᨖᨗ", ="ᨖᨘ", ="ᨖᨙ", ="ᨖᨚ",
="ᨕ", ="ᨕᨗ", ="ᨕᨘ", ="ᨕᨙ", ="ᨕᨚ",
="ᨂ", ="ᨂᨗ", ="ᨂᨘ", ="ᨂᨙ", ="ᨂᨚ",
="ᨎ", ="ᨎᨗ", ="ᨎᨘ", ="ᨎᨙ", ="ᨎᨚ",
};
function export.tr(text, lang, sc)
if (sc == "Latn") then
-- Lowercase
text = mw.ustring.lower(text)
-- Remove glottal stop
text = mw.ustring.gsub(text, "\'", "")
text = mw.ustring.gsub(text, "ʼ", "")
-- Replace character clusters
text = mw.ustring.gsub(text, "ng", tt)
text = mw.ustring.gsub(text, "ny", tt)
-- Replace the rest of the characters
text = mw.ustring.gsub(text, "", tt)
-- Replace one-vowel syllables
text = mw.ustring.gsub(text, "", tt)
-- Remove left-overs
text = mw.ustring.gsub(text, "", "")
end
return mw.ustring.toNFC(text)
end
return export