Modulo:Citazione: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix refuso
Etichette: Modifica da mobile Modifica da web per mobile
Aggiorno check ID SBN (i BID con forma IT\ICCU\CFI\0123456 sono ormai obsoleti, la forma attuale è CFI0123456); User:Horcrux si potrebbe fare una sostituzione massiva via bot?
 
(10 versioni intermedie di 2 utenti non mostrate)
Riga 98:
 
--[[ ===============================================================================
Ritorna true/false a seconda che la stringa siasi esclusivamentepossa inscrivere caratteriin latinicorsivo
===============================================================================]]
local function is_latinis_italicizable( str )
return require('Modulo:IsLatinValido in corsivo')._IsLatin_main({ str })
end
 
Riga 476:
if type(links) == 'table' then
for _, t in ipairs(links) do
t[2] = is_latinis_italicizable( t[2] ) and wrap( 'italic-title', t[2] ) or t[2]
value = value .. ' / ' .. external_link( t[1], t[2] )
end
Riga 540:
local function sbn(id)
local handler = cfg.id_handlers['SBN']
local start_match, end_match, cd1, cd2 = string.find(id, '^IT\\ICCU\\(...)\\(%d+)')
if not(cd1 and cd2) then
start_match, end_match, cd1, cd2 = string.find(id, '^IT\\ICCU\\(....)\\(%d+)')
end
if cd1 and cd2 then
Riga 983:
local Translator = A['Translator'];
local Institution = A['Institution'];
local Collection = A['Collection'];
local SupplementOf = A['SupplementOf'];
 
if is_set(OriginalTitle) and not is_set(TransTitle) then
Riga 1 189 ⟶ 1 191:
end
-- evito ripetizione se il dominio è stato usato come titolo o editore
if is_set(Periodical) andthen
if mw.ustring.lower(Title or '') == mw.ustring.lower(Periodical) then
Periodical = nil''
end
if Periodical and mw.ustring.lower(PublisherName or '') == mw.ustring.lower(Periodical) then
PublisherName = nil''
end
end
auto_Periodical = true
end
------------------------------------------------------------------------------
-- Per cambiare posizione a collane o serie di libri nella citazione,
-- rispetto a nomi di rivistaed evitare di precederle con un "in"
-- TODO per il momento commentato (da rivedere per chiarire collana/opera)
------------------------------------------------------------------------------
-- local Book_series = ''
-- if is_set(Periodical) and (A:ORIGIN('Periodical') == "opera" or A:ORIGIN('Periodical') == "collana") then
-- Book_series = "collana " .. wrap( 'italic-title', Periodical );
-- Periodical = '';
-- end
 
------------------------------------------------------------------------------
Riga 1 222 ⟶ 1 216:
 
---------------------------------------------------------------
-- Compone la stringa deldella linguaggiolingua
---------------------------------------------------------------
local Language_code = ""
Riga 1 240 ⟶ 1 234:
first_language = frame_lingue[1]:lower();
local lg_error;
Language_code, lg_error = require("Modulo:LinguaggiLingue").lingue(frame_lingue)
if lg_error and #lg_error > 0 then
local error_string = mw.text.listToText(lg_error, ", ", " e " )
Riga 1 299 ⟶ 1 293:
-- Recupero e formatto lista curatori
------------------------------------------------------------------------------
local EditorCount, msg_editors
local CuratoriEtal = A['Etalcuratori']
control.coauthors = false
ifcontrol.etal = is_set(CuratoriEtal) then
control.etal = true
else
control.etal = false
end
if is_set(Editors) then
msg_editors = 'editors'
else
local EditorCount
Editors, EditorCount = list_people(control, e)
if is_set(Editors) then
ifmsg_editors = EditorCount <= 1 then msg_editors =and 'editor' else msg_editors =or 'editors' end
end
end
------------------------------------------------------------------------------
-- Se non sono definiti autori sostituisco con curatori
------------------------------------------------------------------------------
if not is_set(Authors) and is_set(Editors) then
Authors = Editors
Editors = ""
end
 
------------------------------------------------------------------------------
-- Recupero e formatto lista autori e curatori di un singolo capitolo dell'opera citata
------------------------------------------------------------------------------
local Contributorsmsg_chapter_editors
local Contributors, ChapterEditors = "", ""
if is_set(Chapter) then
local ChapterEditorCount
local c = extract_names( args, 'ContributorList', A:ORIGIN('Chapter') );
control.etal = false
Contributors = list_people(control, c)
local c = extract_names( args, 'ContributorList', A:ORIGIN('Chapter') );)
ChapterEditors, ChapterEditorCount = list_people(control,
extract_names( args, 'ChapterEditorList', A:ORIGIN('Chapter') ))
if is_set(EditorsChapterEditors) then
msg_chapter_editors = ChapterEditorCount <= 1 and 'editor' or 'editors'
end
end
 
Riga 1 451 ⟶ 1 442:
TransChapter = ""
else
TransChapter = wrap( is_italicizable(TransChapter) and 'trans-italic-title' or 'trans-quoted-title', TransChapter )
end
end
Chapter = is_latinis_italicizable( Chapter ) and wrap( 'italic-title', Chapter ) or Chapter;
if is_set(TransChapter) then Chapter = Chapter .. " " .. TransChapter end
if is_set(Chapter) then
Riga 1 488 ⟶ 1 479:
TransTitle = ""
else
TransTitle = wrap( is_italicizable(TransTitle) and 'trans-italic-title' or 'trans-quoted-title', TransTitle )
end
end
Title = is_latinis_italicizable( Title ) and wrap('italic-title', Title ) or Title;
if is_set(TransTitle) then Title = Title .. " " .. TransTitle end
if is_set(Title) then
Riga 1 603 ⟶ 1 594:
elseif is_set(PublisherName) then
PublisherName = PublisherName .. " " .. OrigDate
elseif is_set(PlasePlace) then
Place = Place .. " " .. OrigDate
else
Riga 1 610 ⟶ 1 601:
end
 
-- sopra si controlla se è vuoto, perciò bisogna formattarlo alla fine.
-- Several of the above rely upon detecting this as nil, so do it last.
if is_set(Periodical) then Periodical = wrap( 'italic-title', Periodical ) end
 
if is_set(SupplementOf) then
-- set translator / illustrator
if not mw.ustring.find(SupplementOf, "^.+''.+''") then
SupplementOf = 'supplemento di ' .. wrap( 'italic-title', SupplementOf )
end
-- end
 
-- Book_seriesif is_set(Collection) then Collection = "'collana "' .. wrap( 'italic-title', PeriodicalCollection ); end
 
if is_set(Translator) then Translator = wrap('translator', Translator) end
if is_set(Illustrator) then Illustrator = wrap('illustrator', Illustrator) end
Riga 1 647 ⟶ 1 645:
fragment_citation:append(fragment_Title)
else
if is_set(AuthorsChapterEditors) and (is_set(EditorsContributors) andor is_set(Title)args["anteposizione-curatore"] and== not is_set(Chapter"no") then
EditorsChapterEditors = 'a cura di ' .. EditorsChapterEditors
fragment_citation = Fragment.new({AuthorsContributors, Chapter, ChapterEditors}, sepc)
fragment_citation:appends({fragment_Title, Editors})
else
if is_set(msg_editorsChapterEditors) then
ChapterEditors = wrap(msg_chapter_editors, ChapterEditors)
if is_set(Editors) then
Editors = wrap(msg_editors, Editors)
else
Authors = wrap(msg_editors, Authors)
end
elseif is_set(Contributors) and is_set(Title) then
Authors, Editors = Contributors, Authors
end
if is_set(Chapter) and not (is_set(Contributors) or is_set(ChapterEditors)) then
fragment_citation = Fragment.new({Authors, Chapter}, sepc)
if Chapter ~= "" or Editors ~= ""is_set(Authors) then
Contributors, Authors = Authors, ""
if A:ORIGIN('Periodical') == 'sito' or auto_Periodical then -- antepone "su" anzichè "in" per i siti web
elseif is_set(Editors) and args["anteposizione-curatore"] ~= "no" then
fragment_citation:last("su")
AuthorsChapterEditors, Editors = wrap(msg_editors, AuthorsEditors), ""
else
fragment_citation:last("in")
end
end
fragment_citation:appends = Fragment.new({Editorsis_set(Contributors) and Contributors or ChapterEditors, fragment_TitleChapter}, sepc)
end
if is_set(Chapter) then
-- antepone "su" anzichè "in" per i siti web
if A:ORIGIN('Periodical') == 'sito' or auto_Periodical then -- antepone "su" anzichè "in" per i siti web
fragment_citation:last("su")
else
fragment_citation:last("in")
end
end
if is_set(Editors) and (is_set(Authors) or args["anteposizione-curatore"] == "no" and not is_set(Chapter)) then
Editors = 'a cura di ' .. Editors
fragment_citation:appends({Authors, fragment_Title, Editors})
else
if not is_set(Authors) and is_set(Editors) then
Editors = wrap(msg_editors, Editors)
end
fragment_citation:appends({is_set(Authors) and Authors or Editors, fragment_Title})
end
end
fragment_citation:appends( { Conference, Periodical, SupplementOf, Collection, Translator, Illustrator, Others, Series, -- Book_series,
Volume, Issue, Edition, Institution, Place, PublisherName, Station, Date, Position } )
local fragment_ID_list = Fragment.new(ID_list, sepc):append(ID):start(",")
Riga 1 680 ⟶ 1 687:
local fragment_Via = Fragment.new(Via):start(".")
local fragment_Quote = Fragment.new({Quote}):start(".")
fragment_citation:appends({fragment_ID_list, fragment_URL, fragment_AccessDate, fragment_Archived, fragment_Via, fragment_Quote})
if PostScript == 'nessuno' then
fragment_citation:last("nothing")
Riga 1 686 ⟶ 1 693:
fragment_citation:last("..")
end
fragment_citation:appends({fragment_Quote})
fragment_citation:start(" ")
local text = Language_code .. tostring(fragment_citation)