الفرق بين المراجعتين لصفحة «وحدة:Wikidata2»

تم إزالة 66 بايت ،  قبل 4 سنوات
لا يوجد ملخص تحرير
end
function p.descriptionIn(framelangcode,id)
 
local lan = langcode or 'ar'
function p.descriptionIn(frame)
local langcode = frame.args[1]
local id = frame.args[2] -- "id" must be nil, as access to other Wikidata objects is disabled in Mediawiki configuration
-- return descriptions of a Wikidata entity in the given language or the default language of this Wikipedia site
local entity = mw.wikibase.getEntityObject(id)
if entity
if entity.descriptions and entity.descriptions ~= ''
then
returnand entity.descriptions[langcode or 'ar'].value.lan..'']
if langcode =='ar'
and entity.descriptions[''..lan..''].value
then
iflocal lang = entity.descriptions['ar'].value == entity.descriptions[lan..'en'].value
if lang['language'] == lan then
then return nil
else return entity.descriptions['ar'..lan..''].value
else return nil end
else
return entity.descriptions[langcode or 'ar'].value
end
return ''
end
end
 
function p.labelIn(framelangcode,id)
local langcodelan = frame.args[1]langcode or 'ar'
local id = frame.args[2] -- "id" must be nil, as access to other Wikidata objects is disabled in Mediawiki configuration
-- return labels of a Wikidata entity in the given language or the default language of this Wikipedia site
local entity = mw.wikibase.getEntityObject(id)
if entity.labels and entity.labels ~= ''
and entity.labels
then
returnand entity.labels[langcode or 'ar'].value.lan..'']
if langcode =='ar'
and entity.labels[''..lan..''].value
then
iflocal lang = entity.labels['ar'].value == entity.labels[lan..'en'].value
if lang['language'] == lan then
then return nil
else return entity.labels['ar'..lan..''].value
else return nil end
else
return entity.labels[langcode or 'ar'].value
end
end
return ''
 
end
function p.descriptionIn(frame)
local langcode = frame.args[1]
local id = frame.args[2] -- "id" must be nil, as access to other Wikidata objects is disabled in Mediawiki configuration
 
return descriptionIn( langcode ,id )
end
 
function p.labelIn(frame)
local langcode = frame.args[1]
local id = frame.args[2] -- "id" must be nil, as access to other Wikidata objects is disabled in Mediawiki configuration
 
return labelIn( langcode ,id )
end