Modulo:Interprogetto/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica |
aggiorno stringa generata |
||
Riga 136:
end
function Wikidata_entity:
if
self.entity.claims[property_language] and
self.entity.claims[property_language][1].mainsnak.datavalue.type == 'wikibase-entityid' then
local entityId = 'Q' .. self.entity.claims[property_language][1].mainsnak.datavalue.value['numeric-id']
local claims = mw.wikibase.getBestStatements(entityId, 'P424')
if language_code then
return { codice = language_code, nome = require('Modulo:Linguaggi').get_voce(language_code) }
end
end
return
end
Riga 156 ⟶ 158:
-- Carica i collegamenti di un progetto solo se non disambigua o tipo di progetto abilitato in disambigua
if not self.disambigua or cfg.parameters[key_progetto].abilita_in_disambigua then
local interwiki =
if progetto.property_language self.lingua[key_progetto] = self:getLanguage(progetto.property_language)
interwiki = mw.message.newRawMessage(interwiki, { self.lingua[key_progetto].codice }):plain()
end
local sitelink = self.entity:getSitelink(interwiki)
-- Dà sempre precedenza al sitelink se è una categoria
Riga 174 ⟶ 180:
if self.from_property_category[key_progetto] then
self.article_link[key_progetto] = sitelink
elseif self.lingua[key_progetto] then
self.collegamenti[key_progetto] = string.format('%s:%s', self.lingua[key_progetto].codice, sitelink)
else
self.collegamenti[key_progetto] = sitelink
Riga 279 ⟶ 287:
self.testo_dopo = ' <small>' .. args.data .. '</small>'
end
if default_progetto.lingua and lingua then
self.lingua = ' in ' .. lingua
else
self.lingua = ''
|