Modulus:Goth-translit
Appearance
Purpose
[+/-]This module will transliterate text written in βLingua Gothicaβ.
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:Goth-translit/testcases.
Functions
[+/-]tr(text, lang, sc)
- Transliterates a given piece of
text
written in the script specified bysc
, and language specified bylang
. When the transliteration fails, returnsnil
.
local export = {}
local Goth_Latn = {
["π°"] = "a",
["π±"] = "b",
["π²"] = "g",
["π³"] = "d",
["π΄"] = "Δ",
["π΅"] = "q",
["πΆ"] = "z",
["π·"] = "h",
["πΈ"] = "ΓΎ",
["πΉ"] = "i",
["πΊ"] = "k",
["π»"] = "l",
["πΌ"] = "m",
["π½"] = "n",
["πΎ"] = "j",
["πΏ"] = "u",
["π"] = "p",
["π"] = "?",
["π"] = "r",
["π"] = "s",
["π"] = "t",
["π
"] = "w",
["π"] = "f",
["π"] = "x",
["π"] = "Ζ",
["π"] = "Ε",
["π"] = "?",
}
local Latn_Goth = {
["Δ"] = "π°",
["e"] = "π΄",
["Δ«"] = "πΉ",
["o"] = "π",
["Ε«"] = "πΏ",
["y"] = "π
",
}
for g, l in pairs(Goth_Latn) do
if l ~= "?" then
Latn_Goth[l] = g
end
end
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, "π΄πΉ", "ei")
return (mw.ustring.gsub(text, '.', Goth_Latn))
end
function export.tr_reverse(text)
text = mw.ustring.lower(text)
return (mw.ustring.gsub(text, '.', Latn_Goth))
end
return export