မဝ်ဂျူ: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 }