Modulo:Bio/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m IMHO ha più senso così |
ciaffo |
||
Riga 759:
end
self:_addText(args.PostCognome)
end
if args.Pseudonimo and not currentTitleEquals(args.Pseudonimo) then
self:_addText(", ", (not args.Sesso or args.Sesso == "M") and "noto" or "nota",
" anche con lo pseudonimo di ", "'''", args.Pseudonimo, "'''")
if args.PostPseudonimo then
if self:_needSpace(args.PostPseudonimo) then
self:_addText(" ")
end
self:_addText(args.PostPseudonimo)
end
end
end
function Incipit:_addNomeCognome()
if args.Titolo then
self:_addText(args.Titolo, " ")
end
if args.Pseudonimo and currentTitleEquals(args.Pseudonimo) then
self:_addText("'''", args.Pseudonimo, "'''")
if args.PostPseudonimo then
if self:_needSpace(args.PostPseudonimo) then
self:_addText(" ")
end
self:_addText(args.PostPseudonimo)
end
self:_addText(", pseudonimo di ")
end
local soprannomecognome = args.Soprannome
if args.Soprannome and args.Cognome then
soprannomecognome = args.Soprannome .. " " .. args.Cognome
end
if soprannomecognome and currentTitleEquals(soprannomecognome) then
self:_addText("'''", soprannomecognome, "'''")
if args.PostSoprannome then
if self:_needSpace(args.PostSoprannome) then
self:_addText(" ")
end
self:_addText(args.PostSoprannome)
end
self:_addText(", vero nome ")
end
-- inizio grassetto
self:_addText("'''")
if args.CognomePrima and args.Nome and args.Cognome then
self:_addText(args.Cognome, " ", args.Nome, mw.getCurrentFrame():expandTemplate{
title = "Nota nome",
args = { [1] = args.CognomePrima, [2] = args.Cognome }
})
else
local no_space
if args.Nome then
self:_addText(args.Nome)
-- niente spazio prima di Cognome se Nome termina con «d'»
no_space = mw.ustring.match(args.Nome, " d'$") and ''
end
if args.Cognome then
self:_addText(no_space or " ", args.Cognome)
end
end
-- fine grassetto
self:_addText("'''")
if args.PostCognomeVirgola then
self:_addText(", ", args.PostCognomeVirgola)
elseif args.PostCognome then
if self:_needSpace(args.PostCognome) then
self:_addText(" ")
end
self:_addText(args.PostCognome)
end
if soprannomecognome and not currentTitleEquals(soprannomecognome) then
self:_addText(", ", (not args.Sesso or args.Sesso == "M") and "detto" or "detta",
" ", "'''", args.Soprannome, "'''")
if args.PostSoprannome then
if self:_needSpace(args.PostSoprannome) then
self:_addText(" ")
end
self:_addText(args.PostSoprannome)
end
end
Line 784 ⟶ 871:
self:_addWlink(args.LuogoNascitaLink, args.LuogoNascita)
if args.LuogoNascitaAlt then
if self:
self:_addText(" ")
end
self:_addText(args.LuogoNascitaAlt)
end
self:_addText(", ")
Line 809 ⟶ 899:
if args.NoteNascita then
if self:_needSpace(args.NoteNascita) then
self:_addText(" ")
end
self:_addText(args.NoteNascita)
end
Line 817 ⟶ 910:
self:_addWlink(args.LuogoMorteLink, args.LuogoMorte)
if args.LuogoMorteAlt then
if self:
self:_addText(" ")
end
self:_addText(args.LuogoMorteAlt)
end
self:_addText(", ")
Line 841 ⟶ 937:
end
end
end
end
-- se date ignote, usa Floruit o lo ricava da Epoca
if not args.AnnoNascita and args.AnnoMorte == "?" then
local fl = args.Floruit
if not fl and cfg.epoche[args.Epoca] then
fl = mw.ustring.gsub(cfg.epoche[args.Epoca], "^del ?l?'?", "")
-- se due epoche, le mette entrambe senza ripetere la parola "secolo"
if cfg.epoche[args.Epoca2] then
if fl ~= "I secolo a.C." then
fl = fl .. "|" .. mw.ustring.gsub(fl, " secolo.*$", "")
end
fl = "[[" .. fl .. "]]-[[" .. mw.ustring.gsub(cfg.epoche[args.Epoca2], "^del ?l?'?", "") .. "]]"
end
end
if fl then
if titleExists(fl) then
fl = "[[" .. fl .. "]]"
end
self:_addText("; [[floruit|fl.]] ", fl)
end
end
if args.NoteMorte then
if self:_needSpace(args.NoteMorte) then
self:_addText(" ")
end
self:_addText(args.NoteMorte)
end
|