Module:Autre exemple

Une page de Wikiversité, la communauté pédagogique libre.

Ce module sert d'exemple dans la leçon Initiation au Lua avec Scribunto. son utilisation est décrite en détail dans la leçon et, par conséquent, ne doit pas être modifié sans tenir compte de la leçon.


local p = {}

function p.traduit(frame)	
	if frame.args[1] == "Lundi" then return "Monday" end
	if frame.args[1] == "Mardi" then return "Tuesday" end
	if frame.args[1] == "Mercredi" then return "Wednesday" end
	if frame.args[1] == "Jeudi" then return "Thursday" end
	if frame.args[1] == "Vendredi" then return "Friday" end
	if frame.args[1] == "Samedi" then return "Saturday" end
	if frame.args[1] == "Dimanche" then return "Sunday" end
end

return p