انتقل إلى المحتوى

وحدة:Wikidata2/P106

صفحة محمية جزئيًّا (سماح للمحررين)
من ويكيبيديا، الموسوعة الحرة

local p = {}
local categoryLinksToEntitiesWithMissingLabel = '[[تصنيف:صفحات بها مهن بحاجة للتأنيث]]';

local skiip = { "Q42857" }

local function formatGenderLabelForEntityId(jobqid, isFemale, options)
	local joblabel = formatStatements({ property = 'P2521', entityId = jobqid, noref = 'true', langpref = 'ar',
		formatting = 'text', rank = "all" }) or ""
	local vv = formatEntityId(jobqid, options)
	if isFemale and (isFemale == 'Q6581072' or isFemale == 'Q1052281') then
		vv = formatEntityId(jobqid, { label = joblabel })
	end
	return vv
end

function p.formatEntityWithGenderClaim(datavalue, datatype, options)
	-- local value = datavalue.value
	local jobqid = datavalue.value.id

	for k, v in pairs(skiip) do
		if jobqid == v then
			mw.log("P106:Q42857 undisplayed.")
			return ""
		end
	end

	local personqid = options.entityId or options.qid
	local gender = formatStatements({ property = 'P21', entityId = personqid, noref = 't', rank = 'all', firstvalue = 't',
		formatting = 'raw' })
	local s = formatGenderLabelForEntityId(jobqid, gender, options).value
	return s
end

return p