Difference between revisions of "Module:Ka-translit"
Jump to navigation
Jump to search
blackwiki>Dixtosa |
blackwiki>Erutuon (standardizing: p rather than export) |
||
Line 1: | Line 1: | ||
− | local | + | local p = {} |
local ISO_9984 = { | local ISO_9984 = { | ||
Line 18: | Line 18: | ||
}; | }; | ||
− | function | + | function p.tr(text) |
if type(text) == "table" then | if type(text) == "table" then | ||
text = text.args[1] | text = text.args[1] | ||
Line 25: | Line 25: | ||
end | end | ||
− | return | + | return p |
Revision as of 19:28, 7 October 2016
Usage
This module creates a transliteration of Georgian text. It is used by Template:T, and that template in turn is used by Template:T.
{{#invoke:Ka-translit|tr|ქართული ენა}}
- kartuli ena
The module returns an error message if the text it is provided does not contain any Georgian characters:
{{#invoke:Ka-translit|tr|kartuli ena}}
- kartuli ena
local p = {}
local ISO_9984 = {
["ა"]="a", ["ბ"]="b", ["გ"]="g", ["დ"]="d", ["ე"]="e", ["ვ"]="v", ["ზ"]="z", ["ჱ"]="ē",
["თ"]="t’", ["ი"]="i", ["კ"]="k", ["ლ"]="l", ["მ"]="m", ["ნ"]="n", ["ჲ"]="y", ["ო"]="o",
["პ"]="p", ["ჟ"]="ž", ["რ"]="r", ["ს"]="s", ["ტ"]="t", ["ჳ"]="w", ["უ"]="u", ["ფ"]="p’",
["ქ"]="k’", ["ღ"]="ḡ", ["ყ"]="q", ["შ"]="š", ["ჩ"]="č’", ["ც"]="c’",
["ძ"]="j", ["წ"]="c", ["ჭ"]="č", ["ხ"]="x", ["ჴ"]="ẖ", ["ჯ"]="ǰ", ["ჰ"]="h", ["ჵ"]="ō", ["ჶ"]="f", ["ჷ"]="ə", ["ჸ"]="ʾ"
};
--current
local national_system = {
["ა"]="a", ["ბ"]="b", ["გ"]="g", ["დ"]="d", ["ე"]="e", ["ვ"]="v", ["ზ"]="z", ["ჱ"]="?",
["თ"]="t", ["ი"]="i", ["კ"]="k'", ["ლ"]="l", ["მ"]="m", ["ნ"]="n", ["ჲ"]="?", ["ო"]="o",
["პ"]="p'", ["ჟ"]="zh", ["რ"]="r", ["ს"]="s", ["ტ"]="t'", ["ჳ"]="?", ["უ"]="u", ["ფ"]="p",
["ქ"]="k", ["ღ"]="gh", ["ყ"]="q'", ["შ"]="sh", ["ჩ"]="ch", ["ც"]="ts",
["ძ"]="dz", ["წ"]="ts'", ["ჭ"]="ch'", ["ხ"]="kh", ["ჴ"]="ẖ", ["ჯ"]="j", ["ჰ"]="h", ["ჵ"]="?", ["ჶ"]="?", ["ჷ"]="?", ["?"]="ʾ"
};
function p.tr(text)
if type(text) == "table" then
text = text.args[1]
end
return (mw.ustring.gsub(text, '.', national_system))
end
return p