Jump to content

Module:chg-translit

From Wiktionary, the free dictionary

A user suggests that this Chagatai module be cleaned up.
Please see the discussion on Requests for cleanup(+) for more information and remove this template after the problem has been dealt with.

This module will transliterate Chagatai 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:chg-translit/testcases.

Functions

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang.
When the transliteration fails, returns nil.

local export = {}

local data = {}

data["chg-Arab"] = {
	-- consonants and vowel
	 ["م"] = "m",  ["ن"] = "n",  ["د"] = "d",   ["ت"] = "t",
     ["ع"] = "g",  ["غ"] = "ğ",  ["ى"] = "i",   ["و" ] = "o",
     ["ج"] = "c",  ["چ"] = "ç",  ["ژ"] = "j",   ["ش"] = "ş",
     ["س"]= "s",  ["ي"] = "y",  ["ل"] = "l",   ["خ"] = "h",
     ["ق"] = "q",  ["ك"] = "k",  ["ې"] = "e",   ["ۈ"] = "ü",
     ["ۆ"] = "ö",  ["ۇ"] = "u",   ["ۋ"] = "w",   ["ڢ"]= "f",
     ["ه"] = "ä",  ["ڭ"] = "ñ",  ["گ"] = "g",   ["ز"] = "z",
     ["ر"] = "r",  ["ې"] = "ı",
     -- punctuation
	 ["؟"]="?",
	 ["،"]=",",
	 
}