模組:Tibt-Deva-translit


Language code in page name (Tibt) not recognized.


local export = {}
local U = mw.ustring.char
local gsub = mw.ustring.gsub
local match = mw.ustring.match
local sub = mw.ustring.sub

local conv = {
	['ཀ']='क', ['ཫ']='क़', ['ཁ']='ख', ['ག']='ग', ['ང']='ङ',
	['ཅ']='च्य', ['ཆ']='छ्य', ['ཇ']='ज्य', ['འ']='अ',
	['ཙ']='च', ['ཚ']='छ', ['ཛ']='ज', ['ཉ']='ञ', ['ཞ']='श़', ['ཟ']='स़',
	['ཊ']='ट', ['ཋ']='ठ', ['ཌ']='ड', ['ཎ']='ण',
	['ཏ']='त', ['ཐ']='थ', ['ད']='द', ['ན']='न', ['ཨ']='अ',
	['པ']='प', ['ཕ']='फ', ['བ']='ब', ['བྷ']='भ', ['མ']='म',
	['ཡ']='य', ['ར']='र', ['ཬ']='ड़', ['ལ']='ल', ['ཤ']='श', ['ཝ']='व', 
    ['ཥ']='ष', ['ས']='स', ['ཧ']='ह', ['ྱ']='्य',

    ['ཱ']='ा', ['ི']='ि', ['ུ']='ु', ['ེ']='े', ['ོ']='ो', ['ཻ']='ै',
    ['ཽ']='ौ', ['྄']='्', ['་']=' ',
	-- chandrabindu    
	['ྃ']='ँ',
	-- anusvara    
	['ཾ']='ं',
	-- visarga    
	['ཿ']='ः',
	-- avagraha
	['྅']='ऽ',
	--punctuation
    ['༎']='॥',
	['།']='।',
	['ༀ']='ॐ',
    --Vedic extensions
    ['ྈ']='ᳵ', ['ྉ']='ᳶ',
}
function export.tr(text, lang, sc)
	text = mw.ustring.gsub(
		text,
		".",
		function(c)
			return conv[c]
		end)
text = mw.ustring.gsub(text, 'गྷ', "घ")
text = mw.ustring.gsub(text, 'जྷ', "झ")
text = mw.ustring.gsub(text, 'डྷ', "ढ")
text = mw.ustring.gsub(text, 'दྷ', "ध")
text = mw.ustring.gsub(text, 'बྷ', "भ")
text = mw.ustring.gsub(text, 'लྷ', "ल्ह")
text = mw.ustring.gsub(text, 'रྷ', "र्ह")
text = mw.ustring.gsub(text, 'बྷ', "ह्")
text = mw.ustring.gsub(text, 'ྭ', "्व")
text = mw.ustring.gsub(text, 'ྲ', "्र")
text = mw.ustring.gsub(text, 'ྐ', "्क")
text = mw.ustring.gsub(text, 'ྑ', "्ख")
text = mw.ustring.gsub(text, 'ྒ', "्ग")
text = mw.ustring.gsub(text, 'ྒྷ', "्घ")
text = mw.ustring.gsub(text, 'ྜྷ', "्ढ")
text = mw.ustring.gsub(text, 'ྡྷ', "्ध")
text = mw.ustring.gsub(text, 'ྦྷ', "्भ")
text = mw.ustring.gsub(text, 'ྔ', "्ङ")
text = mw.ustring.gsub(text, 'ྟ', "्त")
text = mw.ustring.gsub(text, 'ྠ', "्थ")
text = mw.ustring.gsub(text, 'ྡ', "्द")
text = mw.ustring.gsub(text, 'ྚ', "्ट")
text = mw.ustring.gsub(text, 'ྛ', "्ठ")
text = mw.ustring.gsub(text, 'ྜ', "्ड")
text = mw.ustring.gsub(text, 'ྣ', "्न")
text = mw.ustring.gsub(text, 'ྤ', "्प")
text = mw.ustring.gsub(text, 'ྥ', "्फ")
text = mw.ustring.gsub(text, 'ྦ', "्ब")
text = mw.ustring.gsub(text, 'ྨ', "्म")
text = mw.ustring.gsub(text, 'ྙ', "्ञ")
text = mw.ustring.gsub(text, 'ྩ', "्च")
text = mw.ustring.gsub(text, 'ྪ', "्छ")
text = mw.ustring.gsub(text, 'ྫ', "्ज")
text = mw.ustring.gsub(text, 'ྕ', "्च्य")
text = mw.ustring.gsub(text, 'ྖ', "्छ्य")
text = mw.ustring.gsub(text, 'ྗ', "्ज्य")
text = mw.ustring.gsub(text, 'ླ', "्ल")
text = mw.ustring.gsub(text, 'ྴ', "्श")
text = mw.ustring.gsub(text, 'ྶ', "्स")
text = mw.ustring.gsub(text, 'ྵ', "्ष")
text = mw.ustring.gsub(text, 'ྸ', "्अ")
text = mw.ustring.gsub(text, 'रྀ', "ऋ")
text = mw.ustring.gsub(text, 'राྀ', "ॠ")
text = mw.ustring.gsub(text, '्ऋ', "ृ")
text = mw.ustring.gsub(text, '्ॠ', "ॄ")
text = mw.ustring.gsub(text, 'अा', "आ")
text = mw.ustring.gsub(text, 'अि', "इ")
text = mw.ustring.gsub(text, 'ाि', "ी")
text = mw.ustring.gsub(text, 'आि', "ई")
text = mw.ustring.gsub(text, 'अु', "उ")
text = mw.ustring.gsub(text, 'ाु', "ू")
text = mw.ustring.gsub(text, 'आु', "ऊ")
text = mw.ustring.gsub(text, 'अे', "ए")
text = mw.ustring.gsub(text, 'अै', "ऐ")
text = mw.ustring.gsub(text, 'अो', "ओ")
text = mw.ustring.gsub(text, 'अौ', "औ")
	return text
end
 
return export