« Module:Biblio » : différence entre les versions

Contenu supprimé Contenu ajouté
Préparation débugage (bis)
indicationDeLangue : simplification, responsabilitePrincipale : correction boucle infinie
Ligne 1 :
local Biblio = {}
 
local moduleLangueLangue = require ( 'Module:Langue' )
 
-- cette simple fonction permet de récupérer les arguement du modèle,
Ligne 51 :
function Biblio.indicationDeLangue ( frame )
local args = extractArgs ( frame )
local languecodeLangue = Langue.codeLangue2 ( args.langue )
local codeLangue = moduleLangue.codeLangue2 ( langue )
if codeLangue ~= '' and codeLangue ~= 'fr' then
languereturn = moduleLangueLangue.nomLangueindicationDeLangue { ('', codeLangue )}
return moduleLangue.indicationDeLangue { langue, codeLangue }
else
return ''
Ligne 63 ⟶ 61 :
function Biblio.responsabilitePrincipale ( frame )
local args = extractArgs ( frame )
local listeRresponsablesnom = {args }['nom1'] or ''
local nom = ( args ['nom1'] or '' ) or ''
if nom == '' then
return ''
end
local listeRresponsables = { }
local directeur = Biblio.abr { 'dir.', 'directeur de publication', abrd = true }
local responsable, prenom, lien , precision, resp
local i = 1
repeat
lien = args [ 'lien' .. i ] or ''
if lien ~= '' then lien = lien .. '|' end
prenom = args [ 'prénom' .. i ] or ''
if prenom ~= '' then prenom = prenom .. ' ' end
end
precision = args [ 'directeur' .. i ] or ''
Ligne 93 ⟶ 90 :
end
responsablelien = '[args [ ' .. lien' .. prenomi ..] nom ..or ']]' .. precision
if lien ~= args [ 'lien' ..then i ] or ''
responsable = '[[' .. lien .. '|' .. prenom .. nom .. ']]' .. precision
else
responsable = prenom .. nom .. precision
end
table.insert ( listeRresponsables, responsable )
i = i + 1
nom = args [ 'nom' .. ( i + 1 ) ] or ''
until nom == ''