Modul:Wikidata utilities: Unterschied zwischen den Versionen
(+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 | return mw.wikibase.getSitelink( entity, globalSiteId ) | ||
else -- entity is table | else -- entity is table | ||
return | return entity:getSitelink( globalSiteId ) | ||
end | end | ||
end | end |