Módulo:Control de autoridades: Diferenzas entre revisións

Contido eliminado Contido engadido
Banjo (conversa | contribucións)
Sen resumo de edición
Banjo (conversa | contribucións)
Sen resumo de edición
 
Liña 22:
local function getIdFromWikidata( item, property )
local id = nil
if item.claims[property] == 'PWikispecies:$1'nil then
local siteLinks = item.sitelinks
if siteLinks then
local speciesWiki = item.sitelinks.specieswiki
if speciesWiki then
id = speciesWiki.title
end
end
return id
elseif item.claims[property] == nil then
return id
end
Liña 94 ⟶ 85:
local valurl = val
if mw.ustring.find( link, 'antweb.org' ) then valurl = mw.ustring.gsub(valurl, ' ', '%%20') end
if type(property) == 'number' then
--doublecheck language for Wildflowers of Israel ID
if property == 3746 then link = mw.ustring.gsub(link, '/hebrew/', '/english/') end
--format spaces in PfaF, e.g. for "Elaeagnus x ebbingei"
if property == 4301 then valurl = mw.ustring.gsub(valurl, ' ', '+') end
end
valurl = mw.ustring.gsub(valurl,'%%','%%%%')
link = mw.ustring.gsub(link, '$1', valurl)
Liña 128 ⟶ 112:
return outStr..'>' .. link .. '</span></span>\n'
else
return '* ' .. mw.text.tag('span', {class='error'}, 'TheO identifieridentificador ' .. id .. ' ' .. rawValue .. ' isnon noté validválido.') .. '\n'
end
end
Liña 239 ⟶ 223:
--warn if unknown(s) present
if #unknownParams > 0 then
local plural = nil
local itthem = nil
if #unknownParams == 1 then
plural = ''
itthem = 'it'
else
plural = 's'
itthem = 'them'
end
if frame:preprocess( '{{REVISIONID}}' ) == '' then
errors = errors..'<div class="hatnote" style="color:red">'..
'<strong>WarningAtención:</strong> unknownparámetros parameter'..plural..'descoñecidos <strong>'..table.concat(unknownParams, ', ')..'</strong>.<br />'..
'PleaseCorríxaos correctou '..itthem..'considere orengadilos consider adding '..itthem..' toa Wikidata.<br />'..
'ThisEsta messagemensaxe is onlyse shownamosa inna previewvista previa.</div>'
end
end
Liña 295 ⟶ 270:
if parentArgs['from'..f] then
 
errors = errors .. mw.text.tag('strong', {class='error'}, 'ErrorErro: "' ..
parentArgs['from'..f] .. '" isnon noté aun validID Wikidatade entityentidade IDWikidata válido.<br />')
end
end
Liña 393 ⟶ 368:
--Categorize
end
if not isNilOrEmpty( parentArgs['from'..f] ) then
--blank "missing from" if 'from' exists
 
--blank "desynced" if 'from' matches current page
end
--cannot be "desynced" if no 'from' params
 
end
end
Liña 452 ⟶ 420:
--Add categories
if string.sub(currentTitle.subpageText,1,9) == 'testcases' then parentArgs['demo'] = true end
 
if not isNilOrEmpty( parentArgs['demo'] ) then
elseif currentTitle.namespace == 0 then
end
return outString .. errors
end