पटलम्:ConvertDigit
"इस मॉड्यूल हेतु प्रलेख पटलम्:ConvertDigit/doc पर बनाया जा सकता है"
-- First, define a table of text to search for, and what to convert it to.
local conversionTable = {
['जनवरी'] = 'January',
['फेब्रुवरी'] = 'February',
['मार्च्'] = 'March',
['एप्रिल्'] = 'April',
['मे'] = 'May',
['जून्'] = 'June',
['जुलै'] = 'July',
['अगष्ट्'] = 'August',
['सेप्टेम्बर्'] = 'September',
['अक्टोबर्'] = 'October',
['नवेम्बर्'] = 'November',
['डिसेम्बर्'] = 'December',
['०'] = '0',
['१'] = '1',
['२'] = '2',
['३'] = '3',
['४'] = '4',
['५'] = '5',
['६'] = '6',
['७'] = '7',
['८'] = '8',
['९'] = '9',
}
-- Then we define a table to hold our function
local p = {}
-- Then we define a function that converts strings using conversionTable.
function p.main(frame)
local s = frame.args[1] -- This gets the first positional argument.
for bn, en in pairs(conversionTable) do -- This converts every string found in the table.
s = mw.ustring.gsub(s, sa, en)
end
return s -- Get the result of the function.
end
return p -- Pass our table containing our function back to Lua.
-- Now we can call our function using {{#invoke:ConvertTime|main|<!-- your text here -->}}.