Zum Inhalt springen

Modul:Wikidata utilities: Unterschied zwischen den Versionen

umgestellt
(+getSitelinkTable)
(umgestellt)
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
return isSet( globalSiteId ) and mw.wikibase.getSitelink( entity, globalSiteId )
return mw.wikibase.getSitelink( entity, globalSiteId )
or mw.wikibase.getSitelink( entity )
else -- entity is table
else -- entity is table
return isSet( globalSiteId ) and entity:getSitelink( globalSiteId )
return entity:getSitelink( globalSiteId )
or entity:getSitelink( globalSiteId )
end
end
end
end
Anonymer Benutzer