Modul:Wikidata utilities: Unterschied zwischen den Versionen
getAliases: lang = contentlanguage
(- typeSearch (-> MarkerBase), + getAliases) |
(getAliases: lang = contentlanguage) |
||
Zeile 2: | Zeile 2: | ||
local FastWikidata = { | local FastWikidata = { | ||
suite = 'FastWikidata', | suite = 'FastWikidata', | ||
serial = '2020-06- | serial = '2020-06-29', | ||
item = 65439025 | item = 65439025 | ||
} | } | ||
Zeile 349: | Zeile 349: | ||
if type( entity ) == 'string' then -- is Q id | if type( entity ) == 'string' then -- is Q id | ||
entity = mw.wikibase.getEntity( entity ) | entity = mw.wikibase.getEntity( entity ) | ||
end | |||
if not lang then | |||
lang = mw.getContentLanguage():getCode() | |||
end | end | ||
local aliases = {} | local aliases = {} | ||
if entity and entity.aliases and entity.aliases[ lang ] then | if entity and entity.aliases and entity.aliases[ lang ] then | ||
for _, alias in | for _, alias in ipairs( entity.aliases[ lang ] ) do | ||
table.insert( aliases, alias.value ) | table.insert( aliases, alias.value ) | ||
end | end |