Module:Traduction multilingue

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[2] == "Anglais" then
		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
	if frame.args[2] == "Espagnol" then
		if frame.args[1] == "Lundi" then return "Lunes" end
		if frame.args[1] == "Mardi" then return "Martes" end
		if frame.args[1] == "Mercredi" then return "Miércoles" end
		if frame.args[1] == "Jeudi" then return "Jueves" end
		if frame.args[1] == "Vendredi" then return "Viernes" end
		if frame.args[1] == "Samedi" then return "Sábato" end
		if frame.args[1] == "Dimanche" then return "Domingo" end
	end
end

return p