বিষয়বস্তুতে চলুন

মডিউল:mnc-translit

উইকিঅভিধান, মুক্ত অভিধান থেকে

এই মডিউলের জন্য মডিউল:mnc-translit/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে

local export = {}

local conv = {
	["ᠠ"] = "a",
	["ᡝ"] = "e",
	["ᡳ"] = "i",
	["ᡟ"] = "y",
	["ᠣ"] = "o",
	["ᡠ"] = "u",
	["ᡡ"] = "ū",
	["ᠨ"] = "n",
	["ᠩ"] = "ng",
	["ᡴ"] = "k",
	["ᡤ"] = "g",
	["ᡥ"] = "h",
	["ᠪ"] = "b",
	["ᡦ"] = "p",
	["ᠰ"] = "s",
	["ᡧ"] = "š",
	["ᡨ"] = "t",
	["ᡩ"] = "d",
	["ᠯ"] = "l",
	["ᠮ"] = "m",
	["ᠴ"] = "c",
	["ᠵ"] = "j",
	["ᠶ"] = "y",
	["ᡵ"] = "r",
	["ᡶ"] = "f",
	["ᠸ"] = "w",
	["ᠺ"] = "k'",
	["ᡬ"] = "g'",
	["ᡭ"] = "h'",
	["ᡮ"] = "ts'",
	["ᡮᡟ"] = "ts",
	["ᡯ"] = "dz",
	["ᡰ"] = "ž",
	["ᠰᡟ"] = "sy",
	["ᡱ"] = "c'",
	["ᡱᡳ"] = "c'y",
	["ᡷ"] = "j",
	["ᡷᡳ"] = "jy",
	["᠎"] = "-",
	["᠈"] = ",",
	["᠉"] = ".",
	[" "] = "-",
	["᠊"] = "-"
}

function export.tr(text, lang, sc)
	if sc ~= "Mong" then
		return nil
	end
	
	text = mw.ustring.gsub(text, "([ᠠᡝᡳᡟᠣᡠᡡᠨᠩᡴᡤᡥᠪᡦᠰᡧᡨᡩᠯᠮᠴᠵᠶᡵᡶᠸᠺᡬᡭᡮᡯᡰᡱᡷ᠈᠉])([ᡟᡳ]?)", function(a, b)
		return conv[a..b] or conv[a] .. conv[b] end)
	return text
end

return export