模块:Message box:修订间差异

添加287字节 、​ 2020年4月24日 (星期五)
小
Simplified
Cquote>Shizhao
小 (格式化时间)
小 (Simplified)
 
(未显示2个用户的4个中间版本)
第246行: 第246行:
local sect
local sect
if args.sect == '' then
if args.sect == '' then
sect = '本' .. (cfg.sectionDefault or '頁面')
sect = '此' .. (cfg.sectionDefault or '页面')
elseif type(args.sect) == 'string' then
elseif type(args.sect) == 'string' then
sect = '本' .. args.sect
sect = '此' .. args.sect
end
end
local issue = args.issue
local issue = args.issue
第281行: 第281行:
end
end
if talkTitle and talkTitle.exists then
if talkTitle and talkTitle.exists then
local talkText = '相關討論可見於'
local talkText = '相关讨论可见于'
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[[%s#%s|讨论页]].', talkText, talkTitle.prefixedText, talk)
end
end
self.talk = talkText
self.talk = talkText
第299行: 第299行:
elseif args.time and args.time ~= '' then
elseif args.time and args.time ~= '' then
date = lang:formatDate('Y年n月j日', args.time)
date = lang:formatDate('Y年n月j日', args.time)
end
if date then
local ok, tempdate = pcall(lang.formatDate, lang, 'Y年n月j日', date) -- 正規化日期
if ok then
date = tempdate
end
end
end
if date then
if date then
第401行: 第407行:
if args.date and args.date ~= '' then
if args.date and args.date ~= '' then
date = args.date
date = args.date
local ok, tempdate = pcall(lang.formatDate, lang, 'Y年n月', date) -- 正規化日期
if ok then
date = tempdate
end
elseif args.time and args.time ~= '' then
elseif args.time and args.time ~= '' then
date = lang:formatDate('Y年n月', args.time)
date = lang:formatDate('Y年n月', args.time)
第477行: 第487行:
end
end
if self.isSubstituted then
if self.isSubstituted then
self:addCat('all', '錯誤使用替換引用的頁面')
self:addCat('all', '错误使用替换引用的页面')
end
end


第500行: 第510行:
:addClass('error')
:addClass('error')
:wikitext(format(
:wikitext(format(
'模板<code>%s[[Template:%s|%s]]%s</code>被錯誤地替代。',
'模板<code>%s[[Template:%s|%s]]%s</code>被错误地替代。',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
))
第602行: 第612行:
:tag('div')
:tag('div')
:css('text-align', 'center')
:css('text-align', 'center')
:wikitext(format('本訊息框使用無效的「type=%s」參數,需要修復。', self.type or ''))
:wikitext(format('此消息框使用无效的「type=%s」参数,需要修复。', self.type or ''))
end
end