אונטערשייד צווישן ווערסיעס פון "יחידה:אינפאקעסטל/פערזענליכקייט"

קיין רעדאגירונג באמערקונג
ק (צמא לדעת האט באוועגט בלאט יחידה:אינפאקעסטל/פערזענלעכקייט צו יחידה:אינפאקעסטל/פערזענליכקייט אן לאזן א ווייטערפירונג: החלפת טקסט – "פערזענלעכ" ב־"פערזענליכ")
אין תקציר עריכה
 
(5 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.)
שורה 3: שורה 3:
local PropertyLink = require('Module:PropertyLink')
local PropertyLink = require('Module:PropertyLink')
local ageModule = require('Module:עלטער')
local ageModule = require('Module:עלטער')
local hebrewDateModule = require('Module:יידישע דאטע')
local hebrewDateModule = require('Module:אידישע דאטום')
local WikidataCrossValidation = require('Module:WikidataCrossValidation')
local WikidataCrossValidation = require('Module:WikidataCrossValidation')


שורה 20: שורה 20:


local function getDeathLabel(deathCause, entityId)
local function getDeathLabel(deathCause, entityId)
entityId = entityId or mw.wikibase.getEntityIdForCurrentPage()
--entityId = entityId or mw.wikibase.getEntityIdForCurrentPage()
if deathCause == nil and entityId ~= nil then
if deathCause == nil and entityId ~= nil then
local deathCauseWikidata = mw.wikibase.getBestStatements(entityId, 'P1196')
local deathCauseWikidata = mw.wikibase.getBestStatements(entityId, 'P1196')
שורה 45: שורה 45:


function getEventDetails(generalDate, hebDate, eventPlace, propDate, propPlace, age, usingWikidata, entityId)
function getEventDetails(generalDate, hebDate, eventPlace, propDate, propPlace, age, usingWikidata, entityId)
entityId = entityId or mw.wikibase.getEntityIdForCurrentPage()
--entityId = entityId or mw.wikibase.getEntityIdForCurrentPage()
age = age or ''
age = age or ''
local formattedEvent
local formattedEvent
שורה 80: שורה 80:
local latestDate = deathDate or birthDate
local latestDate = deathDate or birthDate
if latestDate == nil then return end
if latestDate == nil then return end
local dateModule = require('Module:דאטע')
local dateModule = require('Module:דאטום')
local success, res = pcall(dateModule.parseDateRange, latestDate, 'raw')
local success, res = pcall(dateModule.parseDateRange, latestDate, 'raw')
if success==false then return end -- there is no known VALID date
if success==false then return end -- there is no known VALID date
שורה 122: שורה 122:
-- 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)
usingDeathWikidata = fillWikidataParam(templateArgs, 'טויט דאטע', 'P570', infoObj)
usingDeathWikidata = fillWikidataParam(templateArgs, 'טויט דאטום', 'P570', infoObj)
local birthDate = getSpeculativeDate(templateArgs['געבורט דאטע'], templateArgs['יידישע געבורט דאטע'])
local birthDate = getSpeculativeDate(templateArgs['געבורט דאטום'], templateArgs['אידישע געבורט דאטום'])
local deathDate = getSpeculativeDate(templateArgs['טויט דאטע'], templateArgs['יידישע טויט דאטע'])
local deathDate = getSpeculativeDate(templateArgs['טויט דאטום'], templateArgs['אידישע טויט דאטום'])
if birthDate~=nil then
if birthDate~=nil then
שורה 133: שורה 133:
age = ageModule.ageCalc(birthDate, nil, true, false, true) or ''
age = ageModule.ageCalc(birthDate, nil, true, false, true) or ''
end
end
local birthDetails, usingBirthWikidataEvent = getEventDetails(templateArgs['געבורט דאטע'], templateArgs['יידישע געבורט דאטע'], templateArgs['געבורט ארט'], 'P569', 'P19', age, usingBirthWikidata, infoObj.args.entityId)
local birthDetails, usingBirthWikidataEvent = getEventDetails(templateArgs['געבורט דאטום'], templateArgs['אידישע געבורט דאטום'], templateArgs['געבורט ארט'], 'P569', 'P19', age, usingBirthWikidata, infoObj.args.entityId)
table.insert(infoObj.templateStructure, 1, {
table.insert(infoObj.templateStructure, 1, {
label='געבורט',
label='געבורט',
שורה 151: שורה 151:
deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId)
deathLabel = getDeathLabel(templateArgs['סיבת המוות'], infoObj.args.entityId)
local age =  ageModule.ageCalc(birthDate, deathDate, false, false, true) or ''
local age =  ageModule.ageCalc(birthDate, deathDate, false, false, true) or ''
local deathDetails, usingDeathWikidataEvent = getEventDetails(templateArgs['טויט דאטע'], templateArgs['יידישע טויט דאטע'], templateArgs['טויט ארט'], 'P570', 'P20', age, usingDeathWikidata, infoObj.args.entityId)
local deathDetails, usingDeathWikidataEvent = getEventDetails(templateArgs['טויט דאטום'], templateArgs['אידישע טויט דאטום'], templateArgs['טויט ארט'], 'P570', 'P20', age, usingDeathWikidata, infoObj.args.entityId)
table.insert(infoObj.templateStructure, 2, {
table.insert(infoObj.templateStructure, 2, {
label=deathLabel,
label=deathLabel,
שורה 162: שורה 162:
table.insert(infoObj.templateStructure, 1, {
table.insert(infoObj.templateStructure, 1, {
label=birthLabel,
label=birthLabel,
data='{{{געבורט דאטע}}}<br/>{{{געבורט ארט}}}'
data='{{{געבורט דאטום}}}<br/>{{{געבורט ארט}}}'
})
})
table.insert(infoObj.templateStructure, 2, {
table.insert(infoObj.templateStructure, 2, {
label=deathLabel,
label=deathLabel,
data='{{{טויט דאטע}}} <br/>{{{טויט ארט}}}'
data='{{{טויט דאטום}}} <br/>{{{טויט ארט}}}'
})
})
end
end