Module:Category described in year/sandbox: Difference between revisions

Content deleted Content added
Null descriptions for now, to prep for alpha
+currYearSortkey = last 2 digits of year
Line 87:
local currGroup = mw.ustring.match(currCat, '^%w+') --Fish/Spiders/default/etc.
if map[currGroup] == nil then map[currGroup] = map['Fish'] end --'Fish' == default
local currYDC = nil --placeholder for year/decade/century
local currYearSortkey = nil --'Fish described in 20th century|currYearSortkey' in 'Fish described in YYYY' type cats
local currYear = mw.ustring.match(currCat, 'in (%d%d%d%d)$')
local currDeca = mw.ustring.match(currCat, 'the (%d%d%d%d)s$')
Line 98 ⟶ 99:
if currYear then
currYDC = 'year'
currYearSortkey = mw.ustring.match(currCat, 'in %d%d(%d%d)$')
parentDeca = mw.ustring.match(currYear, '^(%d%d%d)%d$') .. '0'
if mw.ustring.match(currYear, '^%d%d00') then --1900 in 19th century
Line 133 ⟶ 135:
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. parentDeca .. 's]]'
elseif parent == 'century' then
categories[iparent] = '[[Category:' .. currGroup .. ' described in the ' .. addOrd(parentCent) .. ' century|' .. currYearSortkey .. ']]'
else --i.e. Animals; require capital first letter?
categories[iparent] = '[[Category:' .. parent .. ' described in ' .. currYear .. ']]'