Changes

Jump to navigation Jump to search
no edit summary
Line 67: Line 67:  
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
Line 103: Line 103:  
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
Line 262: Line 262:  
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
Anonymous user

Navigation menu