Zum Inhalt springen

Modul:Wikidata utilities: Unterschied zwischen den Versionen

vereinfacht
(umgestellt)
(vereinfacht)
Zeile 4: Zeile 4:
local WikidataUtilities = {
local WikidataUtilities = {
suite  = 'WikidataUtilities',
suite  = 'WikidataUtilities',
serial = '2020-11-21',
serial = '2020-11-22',
item  = 65439025
item  = 65439025
}
}
Zeile 80: Zeile 80:
if not isSet( entity ) then
if not isSet( entity ) then
return nil
return nil
end
if not globalSiteId then
globalSiteId = mw.getContentLanguage():getCode() .. mw.site.siteName:lower()
end
end
if type( entity ) == 'string' then -- entity is id
if type( entity ) == 'string' then -- entity is id
Zeile 92: Zeile 89:


function wu.getSitelinkTable( entity, globalSiteId )
function wu.getSitelinkTable( entity, globalSiteId )
if not isSet( entity ) then
if not isSet( entity ) or not isSet( globalSiteId ) then
return nil
return nil
elseif type( entity ) == 'string' then -- entity is id
elseif type( entity ) == 'string' then -- entity is id
entity = mw.wikibase.getEntity( entity )
entity = mw.wikibase.getEntity( entity )
end
if not globalSiteId then
globalSiteId = mw.getContentLanguage():getCode() .. mw.site.siteName:lower()
end
end
if entity and entity.sitelinks then
if entity and entity.sitelinks then
Anonymer Benutzer