Source : bn:Module:ConvertDigit


-- 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 }