Модуль:Wikidata2: юрамалар арасында аерма

Контент бетерелгән Контент өстәлгән
Ajdar (бәхәс | кертем)
Яңа бит: «local i18n = { ["errors"] = { ["property-param-not-provided"] = "Не дан параметр свойства", ["entity-not-found"] = "Сущность н…»
 
Lucie Kaffee (WMDE) (бәхәс | кертем)
Change from mw.wikibase.getEntity (deprecated) to mw.wikibase.getEntityObject
Юл номеры - 17:
function getEntityFromId( id )
if id then
return mw.wikibase.getEntitygetEntityObject( id )
end
return mw.wikibase.getEntitygetEntityObject()
end
 
Юл номеры - 25:
local prefix = ''
if value['entity-type'] == 'item' then
prefix = 'qQ'
elseif value['entity-type'] == 'property' then
prefix = 'pP'
else
return formatError( 'unknown-entity-type' )
Юл номеры - 33:
return prefix .. value['numeric-id']
end
 
function formatError( key )
return '<span class="error">' .. i18n.errors[key] .. '</span>'
end
 
 
function formatStatements( options )
Строка 50 ⟶ 49 :
end
 
if (entity.claims == nil) or (not entity.claims[string.lowerupper(options.property)]) then
return '' --TODO error?
end
Строка 56 ⟶ 55 :
--Format statement and concat them cleanly
local formattedStatements = {}
for i, statement in pairs( entity.claims[string.lowerupper(options.property)] ) do
table.insert( formattedStatements, formatStatement( statement, options ) )
end