יחידה:LocationAndCountry – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
מאין תקציר עריכה
הצגת שמות באנגלית אם לא קיימים בעברית
שורה 157:
local claims = nil
local workingEntityId = nil
local countryProperty = 'P17'
local administrativeUnitProperty = 'P131'
if type(entity) == 'table' then
workingEntityId = entity.id
שורה 181 ⟵ 183:
--attempt to also load administrative unit, but only if present as a qualifier
local unitQualifier = actualClaim.qualifiers and actualClaim.qualifiers['P131'administrativeUnitProperty] and actualClaim.qualifiers['P131'administrativeUnitProperty][1]
if unitQualifier and unitQualifier.snaktype == 'value' then
table.insert(locationEntitiesIds, unitQualifier.datavalue.value.id)
שורה 188 ⟵ 190:
-- attempt to identify country in the qualifier first, but if it's not, go to the entity
local countryQualifier = actualClaim.qualifiers and actualClaim.qualifiers['P17'countryProperty] and actualClaim.qualifiers['P17'countryProperty][1]
local countryId = nil
local ts = nil
שורה 218 ⟵ 220:
end
countryClaim = findClaimForTimestamp(locationEntityId, 'P17'countryProperty, ts)
if countryClaim and countryClaim.mainsnak and countryClaim.mainsnak.snaktype == 'value' then
countryId = countryClaim.mainsnak.datavalue.value.id
שורה 245 ⟵ 247:
]]
end
table.insert(locationNamesList, locationNames[eachLocationId])
if not missingEntityLabel then
table.insert(locationNamesList, locationNames[eachLocationId])
end
end
if 0 < #locationNamesList then