Modulo:Bio: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m modulo no globals obsoleto
aggiusto le modifiche di novembre
 
(15 versioni intermedie di 3 utenti non mostrate)
Riga 189:
if args.ForzaOrdinamento then
sortkey = args.ForzaOrdinamento:gsub("(.-)%s*,%s*(.*)", "%1 ,%2")
elseif args.Soprannome and args.Cognome and currentTitleEquals(args.Soprannome .. " " .. args.Cognome) then
sortkey = mString.collate( { args = { args.Cognome .. " ," .. args.Soprannome } } )
elseif args.Pseudonimo and currentTitleEquals(args.Pseudonimo) then
local pseudonimo = mString.collate( { args = { args.Pseudonimo } } )
Riga 427 ⟶ 429:
-- Aggiunge le categorie: Attività nazionalità [del XYZ secolo]
function CategoryManager:_addAttivita(plurals)
local catname, epoca1, epoca2, added, addatt, addnaz, add1, nazmonosec, addmonosec
addatt = {}
addnaz = {}
nazmonosec = {"cecoslovacchi", "jugoslavi", "sovietici"}
 
-- se Epoca e Epoca2 non sono stati inseriti dall'utente
Riga 460 ⟶ 463:
else
self:_addCategory(catname)
for _, v in ipairs(nazmonosec) do -- pezza per naz. monosecolo
if plurals[nazionalita] == v then
addmonosec = true
end
end
end
end
Riga 476 ⟶ 484:
if plurals[nazionalita] and not addnaz[nazionalita] then
add1 = self:_addCatSecolo(plurals[nazionalita], epoca1, epoca2) or add1
for _, v in ipairs(nazmonosec) do -- pezza per naz. monosecolo
if plurals[nazionalita] == v and not add1 and not addmonosec then
self:_addCategory(plurals[nazionalita])
add1 = true
end
end
end
end
if not add1 and not addmonosec then
self:_addCatSecolo("Persone", epoca1, epoca2)
end
Riga 610 ⟶ 624:
self:_addNomeCognome()
self:_addNascitaMorte()
if args.Soprannome or args.Pseudonimo or args.PostCognomeVirgola then
self:_addText(",")
end
Riga 676 ⟶ 690:
 
 
-- Restituisce true se text necessita di uno spazio iniziale (PostCognome, PostSoprannome, PostPseudonimo, LuogoNascitaAlt, NoteNascita, LuogoMorteAlt, NoteMorte, AttivitàAltre, PostNazionalità, FineIncipit)
-- Restituisce true se text (AttivitàAltre, PostNazionalità, PostCognome e FineIncipit) necessita di uno spazio iniziale
function Incipit:_needSpace(text)
return mw.ustring.match(mw.ustring.sub(text, 1, 1), "%w") ~= nil or
Riga 718 ⟶ 732:
elseif args.Pseudonimo and currentTitleEquals(args.Pseudonimo) then
caption = args.Pseudonimo
elseif args.Soprannome and args.Cognome and currentTitleEquals(args.Soprannome .. " " .. args.Cognome) then
caption = args.Soprannome .. " " .. args.Cognome
elseif args.Soprannome and currentTitleEquals(args.Soprannome) then
caption = args.Soprannome
else
if args.CognomePrima and args.Nome and args.Cognome then
Riga 786 ⟶ 804:
end
self:_addText(args.PostCognome)
end
 
if args.Soprannome 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("; [[floruit|fl.]] ", fl)
end
self:_addText(args.PostSoprannome)
end
end
 
Riga 803 ⟶ 832:
-- si apre la parentesi
self:_addText(" (")
 
if args.PreData then
self:_addText(args.PreData, "; ")
end
local datimancanti = not (args.LuogoNascita or args.GiornoMeseNascita or args.NoteNascita or args.LuogoMorte or args.GiornoMeseMorte)
local floruit = args.AnnoMorte == "?" and (args.Floruit or cfg.epoche[args.Epoca])
 
if args.LuogoNascita then
self:_addWlink(args.LuogoNascitaLink, args.LuogoNascita)
if args.LuogoNascitaAlt then
if self:_addText_needSpace(" ", args.LuogoNascitaAlt) then
self:_addText(" ")
end
self:_addText(args.LuogoNascitaAlt)
end
self:_addText(", ")
Riga 831 ⟶ 866:
self:_addText(args.AnnoNascita)
end
elseif not floruit or not datimancanti then
else
self:_addText("...")
end
 
if args.NoteNascita then
if self:_needSpace(args.NoteNascita) then
self:_addText(" ")
end
self:_addText(args.NoteNascita)
end
 
if args.AnnoMorte and (not floruit or not datimancanti) then
self:_addText(" – ")
if args.LuogoMorte then
self:_addWlink(args.LuogoMorteLink, args.LuogoMorte)
if args.LuogoMorteAlt then
if self:_addText_needSpace(" ", args.LuogoMorteAlt) then
self:_addText(" ")
end
self:_addText(args.LuogoMorteAlt)
end
self:_addText(", ")
Riga 873 ⟶ 914:
-- 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?'?", "")
Riga 888 ⟶ 929:
fl = "[[" .. fl .. "]]"
end
if not datimancanti then
self:_addText("; [[floruit|fl.]] ", fl)
self:_addText("; ")
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
 
-- si chiude la parentesi
self:_addText(")")
end