Modulo:Interprogetto/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica
aggiorno stringa generata
Riga 136:
end
 
function Wikidata_entity:getInterwikigetLanguage(pattern, property_language)
if property_languageself.entity.claims and
self.entity.claims and
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')
returnlocal language_code = claims[1] and mw.message.newRawMessage(pattern, { claims[1].mainsnak.datavalue.value }):plain()
if language_code then
return { codice = language_code, nome = require('Modulo:Linguaggi').get_voce(language_code) }
end
end
return patternnil
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 = self:getInterwiki(progetto.interwiki,
if progetto.property_language) then
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
iflocal default_progetto.lingua and= argsself.lingua[key_progetto] ..and '_lingua'self.lingua[key_progetto].nome thenor
self args[key_progetto ..lingua = '_lingua'] inand 'lingua ' .. args[key_progetto .. '_lingua']
if default_progetto.lingua and lingua then
self.lingua = ' in ' .. lingua
else
self.lingua = ''