Diferencies ente revisiones de «Módulu:WikidataCheck»
Contenido eliminado Contenido añadido
mSin resumen de edición |
Sin resumen de edición |
||
Llinia 10:
local catbase = config.category
local namespaces = config.namespaces
local ok = false -- one-way flag to check if we're in a good namespace
local ns = mw.title.getCurrentTitle().namespace
Línea 25 ⟶ 24:
return "[[Categoría:Wikipedia:" .. catbase .. " non en Wikidata]]"
end
if value == "" then▼
return nil -- Using Wikidata▼
end▼
▲ local claims = entity.claims or {}
▲ local hasProp = claims[property]
local propValue = hasProp[1].mainsnak.datavalue.value -- This should eventually iterate over all possible values?
▲ if not hasProp then -- no claim of that property
▲ return "[[Categoría:Wikipedia:" .. catbase .. " non en Wikidata]]" -- bad. Bot needs to add the property
end▼
▲ if propValue == value then
▲ return "[[Categoría:Wikipedia:" .. catbase .. " igual en Wikidata]]" -- yay!
▲ else
▲ return "[[Categoría:Wikipedia:" .. catbase .. " diferente en Wikidata]]" -- needs human review :(
end
|