今天是2024年7月1日 第27周 星期一

代人,时大变了。

我们生活在大地上,但我们的梦想超越天空。

更改

跳到导航 跳到搜索
删除1,060字节 、 2014年4月12日 (六) 23:07
以“-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}}, -- {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}. -- Require...”为内容创建页面
第1行: 第1行: −
-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
+
-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}},
 +
-- {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
    
-- Require necessary modules.
 
-- Require necessary modules.
第121行: 第122行:  
nsVals[i] = format('"%s"', val)
 
nsVals[i] = format('"%s"', val)
 
end
 
end
error(' 無效的ns參數傳送到box:addCat ;有效的數值為' .. mw.text.listToText(nsVals, '、', ' '))
+
error('invalid ns parameter passed to box:addCat; valid values are ' .. mw.text.listToText(nsVals, nil, ' or '))
 
end
 
end
 
self[tname] = self[tname] or {}
 
self[tname] = self[tname] or {}
第157行: 第158行:  
end
 
end
 
tinsert(boxTypes, '"mbox"')
 
tinsert(boxTypes, '"mbox"')
error(format(' 無效的訊息框類型「%s 」;有效的類型為%s', tostring(boxType), mw.text.listToText(boxTypes)), 2)
+
error(format('invalid message box type "%s"; valid types are %s', tostring(boxType), mw.text.listToText(boxTypes)), 2)
 
end
 
end
 
return cfg
 
return cfg
第243行: 第244行:  
local sect
 
local sect
 
if args.sect == '' then
 
if args.sect == '' then
sect = ' ' .. (cfg.sectionDefault or ' 頁面')
+
sect = 'This ' .. (cfg.sectionDefault or 'page')
 
elseif type(args.sect) == 'string' then
 
elseif type(args.sect) == 'string' then
sect = ' ' .. args.sect
+
sect = 'This ' .. args.sect
 
end
 
end
 
local issue = args.issue
 
local issue = args.issue
第255行: 第256行:  
tinsert(issues, issue)
 
tinsert(issues, issue)
 
tinsert(issues, text)
 
tinsert(issues, text)
self.issue = tconcat(issues)
+
self.issue = tconcat(issues, ' ')
 
end
 
end
   第278行: 第279行:  
end
 
end
 
if talkTitle and talkTitle.exists then
 
if talkTitle and talkTitle.exists then
local talkText = ' 相關討論可見於'
+
local talkText = 'Relevant discussion may be found on'
 
if talkArgIsTalkPage then
 
if talkArgIsTalkPage then
talkText = format('%s[[%s|%s]].', talkText, talk, talkTitle.prefixedText)
+
talkText = format('%s [[%s|%s]].', talkText, talk, talkTitle.prefixedText)
 
else
 
else
talkText = format('%s[[%s#%s| 討論頁]].', talkText, talkTitle.prefixedText, talk)
+
talkText = format('%s the [[%s#%s|talk page]].', talkText, talkTitle.prefixedText, talk)
 
end
 
end
 
self.talk = talkText
 
self.talk = talkText
第289行: 第290行:     
-- Get other values.
 
-- Get other values.
 +
self.fix = args.fix ~= '' and args.fix or nil
 
local date
 
local date
 
if args.date and args.date ~= '' then
 
if args.date and args.date ~= '' then
 
date = args.date
 
date = args.date
 
elseif args.date == '' and self.isTemplatePage then
 
elseif args.date == '' and self.isTemplatePage then
date = lang:formatDate('Y 年n月j日')
+
date = lang:formatDate('F Y')
elseif args.time and args.time ~= '' then
  −
date = lang:formatDate('Y年n月j日', time)
   
end
 
end
 
if date then
 
if date then
self.date = format("<small> %s )</small>", date)
+
self.date = format(" <small>''(%s)''</small>", date)
end
  −
if args.fix and args.fix ~= '' then
  −
self.fix = format("<br /><small>%s</small>", args.fix)
  −
else
  −
self.fix = ''
   
end
 
end
 
self.info = args.info
 
self.info = args.info
第361行: 第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
+
local date = args.date
local sortDay
  −
local dayName = {
  −
[1] = '㏠',
  −
[2] = '㏡',
  −
[3] = '㏢',
  −
[4] = '㏣',
  −
[5] = '㏤',
  −
[6] = '㏥',
  −
[7] = '㏦',
  −
[8] = '㏧',
  −
[9] = '㏨',
  −
[10] = '㏩',
  −
[11] = '㏪',
  −
[12] = '㏫',
  −
[13] = '㏬',
  −
[14] = '㏭',
  −
[15] = '㏮',
  −
[16] = '㏯',
  −
[17] = '㏰',
  −
[18] = '㏱',
  −
[19] = '㏲',
  −
[20] = '㏳',
  −
[21] = '㏴',
  −
[22] = '㏵',
  −
[23] = '㏶',
  −
[24] = '㏷',
  −
[25] = '㏸',
  −
[26] = '㏹',
  −
[27] = '㏺',
  −
[28] = '㏻',
  −
[29] = '㏼',
  −
[30] = '㏽',
  −
[31] = '㏾'
  −
}
  −
if args.date and args.date ~= '' then
  −
date = args.date
  −
elseif args.time and args.time ~= '' then
  −
date = lang:formatDate('Y年n月', time)
  −
sortDay = lang:formatDate('j', time)
  −
sortDay = tonumber(sortDay)
  −
sortDay = dayName[sortDay]
  −
end
   
date = type(date) == 'string' and date
 
date = type(date) == 'string' and date
local preposition = ' '
+
local preposition = 'from'
 
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)]
第412行: 第365行:  
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', preposition, date, mainCat)
+
local catTitle = format('%s %s %s', mainCat, preposition, date)
if sortDay then
+
self:addCat('main', catTitle)
self:addCat('main', catTitle, sortDay)
  −
else
  −
self:addCat('main', catTitle)
  −
end
   
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', ' 模板中使用无效日期参数的条目')
+
self:addCat('main', 'Articles with invalid date parameter in template')
 
end
 
end
 
elseif mainCat and (not date or date == '') then
 
elseif mainCat and (not date or date == '') then
第471行: 第420行:  
if self.invalidTypeError then
 
if self.invalidTypeError then
 
local allSort = (self.nsid == 0 and 'Main:' or '') .. self.title.prefixedText
 
local allSort = (self.nsid == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', ' 需要修复的信息框', allSort)
+
self:addCat('all', 'Wikisource message box parameter needs fixing', allSort)
 
end
 
end
 
if self.isSubstituted then
 
if self.isSubstituted then
self:addCat('all', ' 錯誤使用替換引用的頁面')
+
self:addCat('all', 'Pages with incorrectly substituted templates')
 
end
 
end
   第497行: 第446行:  
.addClass('error')
 
.addClass('error')
 
.wikitext(format(
 
.wikitext(format(
' 模板<code>%s[[Template:%s|%s]]%s</code> 被錯誤地替代。',
+
'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
 
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
 
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
 
))
 
))
第551行: 第500行:  
.tag('span')
 
.tag('span')
 
.addClass('hide-when-compact')
 
.addClass('hide-when-compact')
.wikitext(self.talk and self.talk)
+
.wikitext(self.talk and ' ' .. self.talk)
 +
.wikitext(self.fix and ' ' .. self.fix)
 
end
 
end
 
textCellSpan
 
textCellSpan
.wikitext(self.date and self.date)
+
.wikitext(self.date and ' ' .. self.date)
if not self.isSmall and self.fix ~= '' then
  −
textCellSpan
  −
.tag('span')
  −
.addClass('hide-when-compact')
  −
.wikitext(self.fix and self.fix)
  −
end
   
if not self.isSmall then
 
if not self.isSmall then
 
textCellSpan
 
textCellSpan
 
.tag('span')
 
.tag('span')
 
.addClass('hide-when-compact')
 
.addClass('hide-when-compact')
.wikitext(self.info and self.info)
+
.wikitext(self.info and ' ' .. self.info)
 
end
 
end
 
else
 
else
第599行: 第543行:  
.tag('div')
 
.tag('div')
 
.css('text-align', 'center')
 
.css('text-align', 'center')
.wikitext(format(' 本訊息框使用無效的「type=%s 」參數,需要修復。', self.type or ''))
+
.wikitext(format('This message box is using an invalid "type=%s" parameter and needs fixing.', self.type or ''))
 
end
 
end
  

导航菜单