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

মডিউল:dng-translit

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

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

local export = {}

local tt = {
	['Б'] = 'B', ['П'] = 'P', ['М'] = 'M', ['Ф'] = 'F', ['В'] = 'V',
	['Д'] = 'D', ['Т'] = 'T', ['Н'] = 'N',              ['Л'] = 'L',
	['З'] = 'Z', ['Ц'] = 'C',              ['С'] = 'S',
	['Җ'] = 'Ž', ['Ч'] = 'Č',              ['Ш'] = 'Š', ['Ж'] = 'Ř',
	--[[  ↑  ]]  --[[  ↑  ]]               ['Щ'] = 'X',
	['Г'] = 'G', ['К'] = 'K', ['Ң'] = 'Ŋ', ['Х'] = 'H',
	                                                    ['Р'] = 'R',

	['Ы'] = 'Ɨ', ['Й'] = 'Y', ['Ў'] = 'W', ['Ү'] = 'Ü',
	--[[  ↑  ]]
	['А'] = 'A', ['Я'] = 'I͡a',
	['Ә'] = 'Ə', ['Е'] = 'I͡ə',
	['Э'] = 'E',
	['О'] = 'O', ['Ё'] = 'I͡o',
	['У'] = 'U', ['Ю'] = 'I͡u',

	['И'] = 'I',

	['б'] = 'b', ['п'] = 'p', ['м'] = 'm', ['ф'] = 'f', ['в'] = 'v',
	['д'] = 'd', ['т'] = 't', ['н'] = 'n',              ['л'] = 'l',
	['з'] = 'z', ['ц'] = 'c',              ['с'] = 's',
	['җ'] = 'ž', ['ч'] = 'č',              ['ш'] = 'š', ['ж'] = 'ř',
	--[[  ↑  ]]  --[[  ↑  ]]               ['щ'] = 'x',
	['г'] = 'g', ['к'] = 'k', ['ң'] = 'ŋ', ['х'] = 'h',
	                                                    ['р'] = 'r',

	['ы'] = 'ɨ', ['й'] = 'y', ['ў'] = 'w', ['ү'] = 'ü',
	--[[  ↑  ]]
	['а'] = 'a', ['я'] = 'i͡a',
	['ә'] = 'ə', ['е'] = 'i͡ə',
	['э'] = 'e',
	['о'] = 'o', ['ё'] = 'i͡o',
	['у'] = 'u', ['ю'] = 'i͡u',

	['и'] = 'i',
};

function export.tr(text, lang, sc)
	if (sc) and (sc ~= 'Cyrl') then
		return nil
	end

	text = mw.ustring.gsub(text, '.', tt)

	return text
end

return export