Module:Copt-translit: Difference between revisions
Jump to navigation
Jump to search
Created page with "local export = {} local chars = { ["Ⲁ"] = "A", ["ⲁ"] = "a", ["Ⲃ"] = "B", ["ⲃ"] = "b", ["Ⲅ"] = "G", ["ⲅ"] = "g", ["Ⲇ"] = "D", ["ⲇ"] = "d", ["Ⲉ"] = "E", ["ⲉ"] = "e", ["Ⲍ"] = "Z", ["ⲍ"] = "z", ["Ⲏ"] = "Ē", ["ⲏ"] = "ē", ["Ⲑ"] = "Th", ["ⲑ"] = "th", ["Ⲓ"] = "I", ["ⲓ"] = "i", ["Ⲕ"] = "K", ["ⲕ"] = "k", ["Ⲗ"] = "L", ["ⲗ"] = "l", ["Ⲙ"] = "M", ["ⲙ"] = "m", ["Ⲛ"] = "N", ["ⲛ"] = "n", ["Ⲻ"] = "N", ["ⲻ"] = "n", ["..." |
m deleted in error |
||
| Line 33: | Line 33: | ||
["Ϧ"] = "X", ["ϧ"] = "x", ["Ⳉ"] = "X", ["ⳉ"] = "x", ["Ⳳ"] = "X", ["ⳳ"] = "x", | ["Ϧ"] = "X", ["ϧ"] = "x", ["Ⳉ"] = "X", ["ⳉ"] = "x", ["Ⳳ"] = "X", ["ⳳ"] = "x", | ||
["Ϩ"] = "H", ["ϩ"] = "h", ["Ⳏ"] = "h", ["ⳏ"] = "h", ["Ⳑ"] = "h", ["ⳑ"] = "h", | ["Ϩ"] = "H", ["ϩ"] = "h", ["Ⳏ"] = "h", ["ⳏ"] = "h", ["Ⳑ"] = "h", ["ⳑ"] = "h", | ||
["Ϫ"] = " | ["Ϫ"] = "J", ["ϫ"] = "j", ["Ⳗ"] = "Č", ["ⳗ"] = "č", ["Ⳙ"] = "Č", ["ⳙ"] = "č", | ||
["Ϭ"] = " | ["Ϭ"] = "Č", ["ϭ"] = "č", ["Ⳛ"] = "C", ["ⳛ"] = "c", | ||
["Ⳝ"] = " | ["Ⳝ"] = "Ç", ["ⳝ"] = "ç", | ||
["Ϯ"] = "Ti", ["ϯ"] = "ti", | ["Ϯ"] = "Ti", ["ϯ"] = "ti", | ||
["Ⲹ"] = "Q", ["ⲹ"] = "q", | ["Ⲹ"] = "Q", ["ⲹ"] = "q", | ||
Revision as of 05:03, 10 February 2026
- 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 Coptic script. It is used to transliterate Coptic, Nobiin, and Old Nubian.
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:Copt-translit/testcases.
Functions
tr(text, lang, sc)- Transliterates a given piece of
textwritten in the script specified by the codesc, and language specified by the codelang. - When the transliteration fails, returns
nil.
local export = {}
local chars = {
["Ⲁ"] = "A", ["ⲁ"] = "a",
["Ⲃ"] = "B", ["ⲃ"] = "b",
["Ⲅ"] = "G", ["ⲅ"] = "g",
["Ⲇ"] = "D", ["ⲇ"] = "d",
["Ⲉ"] = "E", ["ⲉ"] = "e",
["Ⲍ"] = "Z", ["ⲍ"] = "z",
["Ⲏ"] = "Ē", ["ⲏ"] = "ē",
["Ⲑ"] = "Th", ["ⲑ"] = "th",
["Ⲓ"] = "I", ["ⲓ"] = "i",
["Ⲕ"] = "K", ["ⲕ"] = "k",
["Ⲗ"] = "L", ["ⲗ"] = "l",
["Ⲙ"] = "M", ["ⲙ"] = "m",
["Ⲛ"] = "N", ["ⲛ"] = "n", ["Ⲻ"] = "N", ["ⲻ"] = "n", ["⳯"] = "n", ["Ⲳ"] = "N", ["ⲳ"] = "n",
["Ⳟ"] = "Ŋ", ["ⳟ"] = "ŋ",
["Ⳡ"] = "Ñ", ["ⳡ"] = "ñ",
["Ⳣ"] = "W", ["ⳣ"] = "w",
["Ⲝ"] = "Ks", ["ⲝ"] = "ks",
["Ⲟ"] = "O", ["ⲟ"] = "o",
["Ⲡ"] = "P", ["ⲡ"] = "p",
["Ⲣ"] = "R", ["ⲣ"] = "r",
["Ⲥ"] = "S", ["ⲥ"] = "s",
["Ⲧ"] = "T", ["ⲧ"] = "t",
["Ⲩ"] = "U", ["ⲩ"] = "u",
["Ⲫ"] = "Ph", ["ⲫ"] = "ph",
["Ⲭ"] = "Kh", ["ⲭ"] = "kh",
["Ⲯ"] = "Ps", ["ⲯ"] = "ps",
["Ⲱ"] = "Ō", ["ⲱ"] = "ō", ["Ⲿ"] = "Ō", ["ⲿ"] = "ō",
["Ϣ"] = "Š", ["ϣ"] = "š", ["Ⳇ"] = "Š", ["ⳇ"] = "š", ["Ⳅ"] = "Š", ["ⳅ"] = "š",
["Ϥ"] = "F", ["ϥ"] = "f",
["Ϧ"] = "X", ["ϧ"] = "x", ["Ⳉ"] = "X", ["ⳉ"] = "x", ["Ⳳ"] = "X", ["ⳳ"] = "x",
["Ϩ"] = "H", ["ϩ"] = "h", ["Ⳏ"] = "h", ["ⳏ"] = "h", ["Ⳑ"] = "h", ["ⳑ"] = "h",
["Ϫ"] = "J", ["ϫ"] = "j", ["Ⳗ"] = "Č", ["ⳗ"] = "č", ["Ⳙ"] = "Č", ["ⳙ"] = "č",
["Ϭ"] = "Č", ["ϭ"] = "č", ["Ⳛ"] = "C", ["ⳛ"] = "c",
["Ⳝ"] = "Ç", ["ⳝ"] = "ç",
["Ϯ"] = "Ti", ["ϯ"] = "ti",
["Ⲹ"] = "Q", ["ⲹ"] = "q",
["Ⳋ"] = "Ç", ["ⳋ"] = "ç", ["Ⳃ"] = "Ç", ["ⳃ"] = "ç",
["Ⳓ"] = "Ḫ", ["ⳓ"] = "ḫ",
["Ⳕ"] = "ḥ", ["ⳕ"] = "ḥ", ["Ⳍ"] = "ḥ", ["ⳍ"] = "ḥ",
["Ⲵ"] = "ʿ", ["ⲵ"] = "ʿ",
["ⳤ"] = "ke",
["⳦"] = "pros",
["⳧"] = "stauros",
["⳨"] = "taur",
["⳪"] = "cōis",
}
function export.tr(text, lang, sc)
return (mw.ustring.gsub(text, '.', chars))
end
return export