ಮೋಡ್ಯೂಲ್:ConvertDigit
Documentation for this module may be created at ಮೋಡ್ಯೂಲ್:ConvertDigit/doc
-- Return input text after converting any en digits and month names.
local en_digits = {
['0'] = '೦',
['1'] = '೧',
['2'] = '೨',
['3'] = '೩',
['4'] = '೪',
['5'] = '೫',
['6'] = '೬',
['7'] = '೭',
['8'] = '೮',
['9'] = '೯',
}
local en_months = {
['January'] = 'ಜನವರಿ',
['january'] = 'ಜನವರಿ',
['February'] = 'ಪೆಬ್ರವರಿ',
['february'] = 'ಪೆಬ್ರವರಿ',
['March'] = 'ಮಾರ್ಚಿ',
['march'] = 'ಮಾರ್ಚಿ',
['April'] = 'ಏಪ್ರಿಲ್',
['april'] = 'ಏಪ್ರಿಲ್',
['May'] = 'ಮೇ',
['may'] = 'ಮೇ',
['June'] = 'ಜೂನ್',
['june'] = 'ಜೂನ್',
['July'] = 'ಜುಲಾಯಿ',
['july'] = 'ಜುಲಾಯಿ',
['August'] = 'ಆಗೋಸ್ಟು',
['august'] = 'ಆಗೋಸ್ಟು',
['September'] = 'ಸಪ್ಟಂಬರ್',
['september'] = 'ಸಪ್ಟಂಬರ್',
['October'] = 'ಅಕ್ಟೋಬರ್',
['october'] = 'ಅಕ್ಟೋಬರ್',
['November'] = 'ನವಂಬರ್',
['november'] = 'ನವಂಬರ್',
['December'] = 'ದಸಂಬರ್',
['december'] = 'ದಸಂಬರ್',
}
local function _main(input)
-- Callable from another module.
input = input or ''
return (input:gsub('%a+', en_months):gsub('%d', en_digits))
end
local function main(frame)
-- Callable from #invoke or from a template.
return _main(frame.args[1] or frame:getParent().args[1])
end
return { main = main, _main = _main }