وحدة:Navseasoncats/ملعب: الفرق بين النسختين

[نسخة منشورة][نسخة منشورة]
تم حذف المحتوى تمت إضافة المحتوى
طلا ملخص تعديل
طلا ملخص تعديل
سطر 192:
return p.failedcat(errors, 'Y')
end
local keykeyNoBC = mw.ustring.gsub(keykey, '%sق م$' , '') --easier than splitting keykey up in 2; AD never used
mw.log("keykeyNoBC: " .. (keykeyNoBC or "") )
--AD/BC switches & vars
السطر 203 ⟵ 204:
firstpart = mw.ustring.gsub(firstpart, '%s*ق م$', '') --handle AD/BC separately for easier & faster accounting
lastpart = mw.ustring.gsub(lastpart, '^BCE?%s*', '')
local BCe = parentBC or yearBCElastparts[lastpart] or 'BC' --"BC" default
local year1to15AD = (year >= 1 and year <= 15 and not parentBC) --special behavior in this range
السطر 223 ⟵ 224:
while ygap1 <= 5 do --Czech Republic, Poland, Sri Lanka, etc. have 5-year terms
--prevseason = firstpart..' '..(year-ygap1)..' '..lastpart
prevseason = mw.ustring.gsub( keykeykeykeyNoBC , "keykey", (year-ygap1) )
mw.log("prevseason:'" .. prevseason .. "'")
if mw.title.new(prevseason, 'Category').exists then
ygap1_success = true
السطر 235 ⟵ 237:
--nextseason = firstpart..' '..(year+ygap2)..' '..lastpart
nextseason = mw.ustring.gsub( keykey , "keykey", (year+ygap2) )
mw.log("nextseason:'" .. nextseason .. "'")
if mw.title.new(nextseason, 'Category').exists then
ygap2_success = true
السطر 298 ⟵ 301:
if (minyear <= ysign) and (ysign <= maxyear) then -- ex: 1758, 1759, 1761, 1762, 1763, 1764, 1765
--caat = firstpart..' '..AD..y..' '..BC .. lastpart
caat = mw.ustring.gsub( keykeykeykeyNoBC , "keykey" , AD..y ..' '..BC AD )
navy = navy..'*'..catlink( caat , y .. BCdisp )..'\n'
else -- ex: 1755, 1756, 1757
navy = navy..'*<span style="visibility:hidden">'.. y .. BCdisp ..'</span>\n'
end
else --center navy; ex: 1760
السطر 337 ⟵ 341:
local keykeyNoBC = mw.ustring.gsub(keykey, '%sق م$' , '') --easier than splitting keykey up in 2; AD never used
mw.log("keykeyNoBC: " .. (keykeyNoBC or "") )
--sterilize mindecade & determine AD/BC