Content deleted Content added
Tom.Reding (talk | contribs) Place upper limit on acceptable minYear value |
Tom.Reding (talk | contribs) Further deprecate decade |
||
Line 133:
local currYDCF = nil --possible future values: year/decade/century/formal
local currYear = mw.ustring.match(currCat, 'described in (%d%d%d%d)$')
local currDeca = mw.ustring.match(currCat, 'described in the (%d%d%d%d)s$') --deprecated
local currCent = mw.ustring.match(currCat, 'described in the (%d+)[snrt][tdh] century$')
local currFrml = mw.ustring.match(currCat, 'by year of (formal) description$')
local lastCent, nextCent = nil, nil
local
local minYear = tonumber(conf[currGroup].minyear)
if minYear == nil or
Line 145:
if currYear then
currYDCF = 'year'
if mw.ustring.match(currYear, '^%d%d00') then --1900 in 19th century
parentCent = mw.ustring.match(currYear, '^%d%d')
Line 155 ⟶ 154:
elseif currDeca then
currYDCF = 'decade'
bConfError = true
elseif currCent then
currYDCF = 'century'
Line 177 ⟶ 176:
elseif conf[currGroup][currYDCF] == nil then
bConfError = true
trackingCategories[2] = '[[Category:Described in year error|2]]' --year
else
if conf[currGroup][currYDCF].description == nil then
Line 196 ⟶ 195:
end
--produce description, evaluate %variables%
description = conf[currGroup][currYDCF].description
if mw.ustring.match(description, '%%year%%') then
if currYear then description = mw.ustring.gsub(description, '%%year%%', currYear) --"2011"
else description = mw.ustring.gsub(description, '%%year%%', 'this year') end
end
if mw.ustring.match(description, '%%century%%') then
Line 231 ⟶ 226:
nav = frame:expandTemplate{ title = 'Navseasoncats', args = args }
end
if parent == '
if isNilOrEmpty(sortkey) then sortkey = currYear end --default to currYear
categories[iparent] = '[[Category:'..currGroup..' described in the '..addOrd(parentCent)..' century|'..sortkey..']]'
Line 260 ⟶ 252:
trackingCategories[2] = '[[Category:Described in year error|Y]]' --invalid year-parent
end
▲ trackingCategories[2] = '[[Category:Described in year error|D]]' --invalid decade-parent (deprecated)
--[[======================== Century =========================]]
|