Aller au contenu

Module:Anstay1

Zɣ Wikipedia

La documentation pour ce module peut être créée à Module:Anstay1/doc

-- Return input text after converting en digits and month names. Testing compatibility, Unicode can be updated later. The Sylheti numeral system has similarities with Indo-Arabic  (0,1,2,3,7,8,9), Mongolian (flipped 4 & 6) and Quarter moon (5) shapes. 
-- According to the "Language proposal policy", Unicode encoding is not required by the policy for a project to be approved. 

local en_digits = {
	['0'] = '0',
	['1'] = '1',
	['2'] = '2',
	['3'] = '3',
	['4'] = '4',
	['5'] = '5',
	['6'] = '6',
	['7'] = '7',
	['8'] = '8',
	['9'] = '9' ,
}

local en_months = {
	['January'] = 'Yanayr',
	['january'] = 'Yanayr',
	['February'] = 'Bṛayṛ',
	['february'] = 'Bṛayṛ',
	['March'] = 'Maṛṣ',
	['march'] = 'Maṛṣ',
	['April'] = 'Abril',
	['april'] = 'Abril',
	['May'] = 'May',
	['may'] = 'May',
	['June'] = 'Yunyu',
	['june'] = 'Yunyu',
	['July'] = 'Yulyuz',
	['july'] = 'Yulyuz',
	['August'] = 'Ɣuct',
	['august'] = 'Ɣuct',
	['September'] = 'Cutanbir',
	['september'] = 'Cutanbir',
	['October'] = 'Uktubṛ',
	['october'] = 'Ukṭubr',
	['November'] = 'Nuvumbṛ',
	['november'] = 'Nuvumbṛ',
	['December'] = 'Dujanbir',
	['december'] = 'Dujanbir',
}

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 }