Changes
Jump to navigation
Jump to search
Line 67:
Line 67:
− +
Line 103:
Line 103:
− +
Line 262:
Line 262:
− +
no edit summary
label = entity:getLabel(language)
label = entity:getLabel(language)
else
else
label = mw.wikibase.getLabelByLang("Item:"..item, language)
label = mw.wikibase.getLabelByLang(item, language)
end
end
if label then break end -- label found and we are done
if label then break end -- label found and we are done
link = '' -- no link
link = '' -- no link
elseif link_type=='wikidata' then
elseif link_type=='wikidata' then
link = "Item:"..item -- link to wikidata
link = dLink -- link to wikidata
elseif link_type=='wikidata talk' and string.sub(item, 1, 1)=='P' then
elseif link_type=='wikidata talk' and string.sub(item, 1, 1)=='P' then
link = 'd:Property talk:'.. item -- link to wikidata property talk page
link = 'd:Property talk:'.. item -- link to wikidata property talk page
local entity
local entity
if type(item)=='string' then -- "item" is a q-code
if type(item)=='string' then -- "item" is a q-code
entity = mw.wikibase.getEntity("Item:"..item);
entity = mw.wikibase.getEntity(item);
else
else
entity = item -- "item" is the entity
entity = item -- "item" is the entity