Line 53:
Line 53:
item = entity.id -- look-up q-code
item = entity.id -- look-up q-code
elseif tonumber(item) then -- if it is just the number than add "Q" in front
elseif tonumber(item) then -- if it is just the number than add "Q" in front
−
item = 'Item:Q'..item
+
item = 'Q'..item
end
end
item = string.gsub( string.upper(item), 'PROPERTY:P', 'P') -- make all the properties the same and capitalize
item = string.gsub( string.upper(item), 'PROPERTY:P', 'P') -- make all the properties the same and capitalize
Line 67:
Line 67:
label = entity:getLabel(language)
label = entity:getLabel(language)
else
else
−
label = mw.wikibase.getLabelByLang(item, language)
+
label = mw.wikibase.getLabelByLang("Item:"..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