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 }