יחידה:תבנית מידע/אישיות: הבדלים בין גרסאות בדף

מאין תקציר עריכה
מ בדיקת מגדר
שורה 20: שורה 20:
end
end


local function getDeathLabel(deathCause, entityId)
local function getDeathLabel(deathCause, entityId, gender)
local result=''
local result=''
local fromWikidata=nil
local fromWikidata=nil
שורה 32: שורה 32:
end
end
end
end
local gender = PropertyLink.getPropertyByOptions( 'P21', entityId )


-- Use female form of address also for transgender females
-- Use female form of address also for transgender females
שורה 96: שורה 95:
end
end


function addMissingImage(infoObj, birthDate, deathDate)
function addMissingImage(infoObj, birthDate, deathDate, gender)
if infoObj.args.image ~= nil and #infoObj.args.image > 0 then return end  -- there is already image  
if infoObj.args.image ~= nil and #infoObj.args.image > 0 then return end  -- there is already image  
local latestDate = deathDate or birthDate
local latestDate = deathDate or birthDate
שורה 106: שורה 105:
if yearsEstimated>150 then return end  
if yearsEstimated>150 then return end  
local gender = nil
if infoObj.args.entityId ~= nil then
gender = PropertyLink.getPropertyByOptions( 'P21', infoObj.args.entityId )
end
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
infoObj.args.image = frame:expandTemplate{ title = 'אין תמונה', args = { gender, ['יישור'] = 'center' } }
infoObj.args.image = frame:expandTemplate{ title = 'אין תמונה', args = { gender, ['יישור'] = 'center' } }
שורה 177: שורה 171:
infoObj.isNonPerson = instanceOfViolation(infoObj)
infoObj.isNonPerson = instanceOfViolation(infoObj)
local wikidataGender = nil
if not infoObj.isNonPerson then
wikidataGender = PropertyLink.getPropertyByOptions( 'P21', infoObj.args.entityId )
if wikidataGender == nil then
table.insert(infoObj.wikidataCats, '[[קטגוריה:אישים חסרי מגדר בוויקינתונים]]')
end
end
-- fill birth/death dates from wikidata is missing
-- fill birth/death dates from wikidata is missing
usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj)
usingBirthWikidata = fillWikidataParam(templateArgs, 'תאריך לידה', 'P569', infoObj)
שורה 203: שורה 205:
end
end
deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId)
deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId, wikidataGender)
if deathDate~=nil then
if deathDate~=nil then
local age =  ageModule.ageCalc(birthDate, deathDate, false, false, true) or ''
local age =  ageModule.ageCalc(birthDate, deathDate, false, false, true) or ''
שורה 246: שורה 248:


if frame.args['תמונה']~='-' then
if frame.args['תמונה']~='-' then
addMissingImage(infoObj, birthDate, deathDate)
addMissingImage(infoObj, birthDate, deathDate, wikidataGender)
end
end
end
end