Module:Translate

De Mythemes

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

local p = {}
local langue = 'fr'
local lang = mw.getLanguage( langue )

local dict = mw.loadData( 'module:Translate/data' )

function p.dict_to_csv()
	local res = ''
	for mot,translation in pairs(dict) do
		res = res .. mot .. ';' ..  translation['de'] .. ';' .. translation['en'] .. ';' .. translation['fr'] .. '<br>'
	end
	return(res)
end

function p.translate(expr,langue)
	if langue == 'fr' then
		return expr 
	else
		return dict[expr] or expr
	end
end

function p.transl(frame)
	local expr =frame.args[1]
	if langue == 'fr' then
		return expr
	else
		return dict[expr] or expr
	end
end

return p