今天是2024年11月20日 第47周 星期三
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
更改
跳到导航
跳到搜索
第342行:
第342行:
− +
+
+
+
+
+
− +
第351行:
第356行:
− +
− +
无编辑摘要
self.categoryParamNums = union(self.categoryParamNums, self.allNums)
self.categoryParamNums = union(self.categoryParamNums, self.allNums)
-- The following is roughly equivalent to the old {{Ambox/category}}.
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
local date
if args.date and args.date ~= '' then
date = args.date
elseif args.time and args.time ~= '' then
date = lang:formatDate('Y年n月', time)
end
date = type(date) == 'string' and date
date = type(date) == 'string' and date
local preposition = 'from'
local preposition = ' 自'
for _, num in ipairs(self.categoryParamNums) do
for _, num in ipairs(self.categoryParamNums) do
local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)]
local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)]
allCat = type(allCat) == 'string' and allCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
if mainCat and date and date ~= '' then
local catTitle = format('%s %s %s', mainCat, preposition, date)
local catTitle = format('%s%s%s', preposition, date, mainCat)
self:addCat('main', catTitle)
self:addCat('main', catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
if not catTitle or not catTitle.exists then
self:addCat('main', 'Articles with invalid date parameter in template')
self:addCat('main', ' 模板中使用无效日期参数的条目')
end
end
elseif mainCat and (not date or date == '') then
elseif mainCat and (not date or date == '') then