67 271
contributi
(SMW property needs to refer Link not Label) |
(Type casting) |
||
(8 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 94: | Riga 94: | ||
if MakeWikiLink then | if MakeWikiLink then | ||
if AddSemantic then | if AddSemantic then | ||
if string.sub(CharLink, 1, 8) == "Special:" then | |||
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLink) | Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLabel) | ||
else | |||
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix .. frame:callParserFunction('#set:', 'Personaggio=' .. CharLink) | |||
end | |||
else | else | ||
Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix | Result['Character'] = Prefix .. '[[' .. CharLink .. '|' .. CharLabel .. ']]' .. Suffix | ||
Riga 106: | Riga 109: | ||
if AddSemantic then | if AddSemantic then | ||
--Result['Actor'] = '[[Interprete::' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel) | --Result['Actor'] = '[[Interprete::' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel) | ||
if string.sub(CharLink, 1, 8) == "Special:" then | |||
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLink) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel) | Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLabel) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel) | ||
else | |||
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' .. frame:callParserFunction('#set:', actorLabel .. '=' .. CharLink) .. frame:callParserFunction('#set:', 'Interprete=' .. actorLabel) | |||
end | |||
else | else | ||
Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' | Result['Actor'] = '[[' .. actorLink .. '|' .. actorLabel .. ']]' | ||
Riga 289: | Riga 295: | ||
mw.smw.set("Istanza=Episodio di " .. SeasonData.SeriesAbbr) | mw.smw.set("Istanza=Episodio di " .. SeasonData.SeriesAbbr) | ||
mw.smw.set("Stagione=" .. SeasonData.SeasonNumber) | mw.smw.set("Stagione=" .. SeasonData.SeasonNumber) | ||
local SeasonOrdinals = | |||
{ | |||
"prima", | |||
"seconda", | |||
"terza", | |||
"quarta", | |||
"quinta", | |||
"sesta", | |||
"settima", | |||
"ottava", | |||
"nona", | |||
"decima" | |||
} | |||
if not mw.wikibase.getDescription() then | if not mw.wikibase.getDescription() then | ||
if not mw.wikibase.getEntity().claims['P20'] then | if not mw.wikibase.getEntity().claims['P20'] then | ||
return "'''''" .. mw.title.getCurrentTitle().text .. "''''' è un episodio della | return "'''''" .. mw.title.getCurrentTitle().text .. "''''' è un episodio della [[Stagione " .. SeasonData.SeasonNumber .. " di " .. SeasonData.SeriesAbbr .. "|" .. SeasonOrdinals[tonumber(SeasonData.SeasonNumber)] .. " stagione]] di ''[[" .. SeasonData.SeriesName .. "]]''." .. string.char(10) | ||
else | else | ||
return "''''" .. mw.title.getCurrentTitle().text .. "'''' è " .. mw.wikibase.getEntity().claims['P20'][1].mainsnak.datavalue['value'] .. string.char(10) | return "''''" .. mw.title.getCurrentTitle().text .. "'''' è " .. mw.wikibase.getEntity().claims['P20'][1].mainsnak.datavalue['value'] .. string.char(10) |