Content deleted Content added
Tom.Reding (talk | contribs) t |
Tom.Reding (talk | contribs) Properly handle 'default to none' sortkeys |
||
Line 269:
end
return ''
end
local function isNilOrEmpty( thing )
return (thing == nil or thing == '')
end
Line 464 ⟶ 468:
end
if parent == 'decade' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..currGroup..' described in the '..parentDeca..'s|'..sortkey..']]'
elseif parent == 'century' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..currGroup..' described in the '..addOrd(parentCent)..' century|'..sortkey..']]'
elseif parent == 'biology' then
if isNilOrEmpty(sortkey
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..currYear..' in biology elseif parent == 'environment' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..currYear..' in the environment'..sortkey..']]'
elseif mw.ustring.match(parent, '^%u%l') then --e.g. Animals/Insects
if isNilOrEmpty(sortkey
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..parent..' described in '..currYear..sortkey..']]'
Line 490 ⟶ 496:
end
if parent == 'century' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..currGroup..' described in the '..addOrd(parentCent)..' century|'..sortkey..']]'
elseif mw.ustring.match(parent, '^%u%l') then --e.g. Animals/Insects
if isNilOrEmpty(sortkey
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..parent..' described in the '..currDeca..'s'..sortkey..']]'
Line 508 ⟶ 514:
end
if parent == 'formal' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..currGroup..' by year of formal description|'..sortkey..']]'
elseif parent == 'biology' then
if isNilOrEmpty(sortkey
categories[iparent] = '[[Category:'..addOrd(currCent)..' century in biology'..sortkey..']]'
elseif parent == 'environment' then
if isNilOrEmpty(sortkey
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..addOrd(currCent)..' century in the environment elseif mw.ustring.match(parent, '^%u%l') then --e.g. Animals/Insects
if isNilOrEmpty(sortkey
else sortkey = '|'..sortkey end
categories[iparent] = '[[Category:'..parent..' described in the '..addOrd(currCent)..' century'..sortkey..']]'
|