This module will transliterate text in the Devanagari 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:Deva-Sind-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 match = mw.ustring.match
local conv = {
='πΊ', ='π»', ='πΌ', ='π½', ='πΎ',
='πΏ', ='π', ='π', ='π', ='π',
='π', ='π
', ='π', ='π', ='π',
='π', ='π', ='π', ='π', ='π',
='π', ='π', ='π', ='π', ='π',
='π', ='π', ='π', ='π', ='π',
='π', ='π', ='π', ='π', ='π',
='π',
='π', ='π»π©', ='πΌπ©', ='πΊπ©', ='ππ©', ='ππ©',
='π ', ='π‘', ='π’', ='π£', ='π€', ='π₯', ='π¦', ='π§', ='π¨', ='πͺ', ='π©',
='π',
-- vowels
='π°', ='π±', ='π²', ='π³', ='π΄', ='π΅', ='πΆ', ='π·', ='πΈ', ='πΉ',
-- anusvara
='π',
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(
text,
".ΰ€Ό?",
function(c)
return conv
end)
return text
end
return export