Documentation for this module may be created at Module:Cprt-translit/doc

local export = {}

local chars = {
	["๐ €"] = "a",
	["๐ "] = "e",
	["๐ ‚"] = "i",
	["๐ ƒ"] = "o",
	["๐ „"] = "u",
	
	["๐ …"] = "ja",
	-- je not in Unicode
	-- ji not in Unicode
	["๐ ˆ"] = "jo",
	-- ju not in Unicode
	
	["๐ Š"] = "ka",
	["๐ ‹"] = "ke",
	["๐ Œ"] = "ki",
	["๐ "] = "ko",
	["๐ Ž"] = "ku",
	
	["๐ "] = "la",
	["๐ "] = "le",
	["๐ ‘"] = "li",
	["๐ ’"] = "lo",
	["๐ “"] = "lu",
	
	["๐ ”"] = "ma",
	["๐ •"] = "me",
	["๐ –"] = "mi",
	["๐ —"] = "mo",
	["๐ ˜"] = "mu",
	
	["๐ ™"] = "na",
	["๐ š"] = "ne",
	["๐ ›"] = "ni",
	["๐ œ"] = "no",
	["๐ "] = "nu",
	
	["๐ ž"] = "pa",
	["๐ Ÿ"] = "pe",
	["๐  "] = "pi",
	["๐ ก"] = "po",
	["๐ ข"] = "pu",
	
	["๐ ฃ"] = "ra",
	["๐ ค"] = "re",
	["๐ ฅ"] = "ri",
	["๐ ฆ"] = "ro",
	["๐ ง"] = "ru",
	
	["๐ จ"] = "sa",
	["๐ ฉ"] = "se",
	["๐ ช"] = "si",
	["๐ ซ"] = "so",
	["๐ ฌ"] = "su",
	
	["๐ ญ"] = "ta",
	["๐ ฎ"] = "te",
	["๐ ฏ"] = "ti",
	["๐ ฐ"] = "to",
	["๐ ฑ"] = "tu",
	
	["๐ ฒ"] = "wa",
	["๐ ณ"] = "we",
	["๐ ด"] = "wi",
	["๐ ต"] = "wo",
	-- wu not in Unicode
	
	["๐ ท"] = "ksa",
	["๐ ธ"] = "kse",
	-- ksi not in Unicode
	["๐ ฟ"] = "kso",
	-- ksu not in Unicode
	
	["๐ ผ"] = "za",
	-- ze not in Unicode
	-- zi not in Unicode
	-- zo not in Unicode
	-- zu not in Unicode
}

function export.tr(text, lang, sc)
	local ret = {}
	
	for c in mw.ustring.gmatch(text, ".") do
		table.insert(ret, chars[c] or c)
	end
	
	return table.concat(ret, "-")
end

return export