This module will transliterate text in the Newa script.
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:Newa-Deva-translit/testcases.
tr(text, lang, sc)
text
written in the script specified by the code sc
, and language specified by the code lang
.nil
.local export = {}
local gsub = mw.ustring.gsub
local conv = {
='क', ='ख', ='ग', ='घ', ='ङ',
='च', ='छ', ='ज', ='झ', ='ञ',
='ट', ='ठ', ='ड', ='ढ', ='ण',
='त', ='थ', ='द', ='ध', ='न',
='प', ='फ', ='ब', ='भ', ='म',
='य', ='र', ='ल', ='व', ='श',
='ष', ='स', ='ह',
-- breathy
='न्ह', ='ङ्ह', ='र्ह', ='ल्ह', ='म्ह', ='ञ्ह',
='ा', ='ि', ='ी', ='ु', ='ू', ='ृ', ='ॄ',
='ॢ', ='ॣ', ='े', ='ै', ='ो', ='ौ', ='्', ='़',
-- vowels
='अ', ='आ', ='इ', ='ई', ='उ', ='ऊ', ='ऋ', ='ॠ',
='ऌ', ='ॡ', ='ए', ='ऐ', ='ओ', ='औ',
-- chandrabindu
='ँ',
-- anusvara
='ं', ='ं',
-- visarga
='ः',
-- avagraha
='ऽ',
--punctuation
='॰',
='॥',
='।',
='ॐ',
--Vedic extensions
='ᳵ', ='ᳶ',
='०', ='१', ='२', ='३', ='४', ='५', ='६', ='७', ='८', ='९'
}
function export.tr(text, lang, sc)
text = gsub(
text,
".",
function(c)
return conv
end)
return text
end
return export