第43行: |
第43行: |
| end | | end |
| error(string.format( | | error(string.format( |
− | 'invalid %s: %s', | + | '%s 「%s 」並非有效的格式!', |
| dateType, | | dateType, |
| tostring(dateString) | | tostring(dateString) |
第50行: |
第50行: |
| | | |
| local function makeFullUrl(page, query, display) | | local function makeFullUrl(page, query, display) |
− | return string.format( | + | return require('Module:Fullurl')._fullurl2(page, query, display) |
− | '[%s %s]',
| |
− | tostring(mw.uri.fullUrl(page, query)),
| |
− | display
| |
− | )
| |
| end | | end |
| | | |
第113行: |
第109行: |
| else | | else |
| error(string.format( | | error(string.format( |
− | 'invalid action: %s', | + | ' 未知動作「%s 」', |
| tostring(args.action) | | tostring(args.action) |
| ), 3) | | ), 3) |
第131行: |
第127行: |
| obj.expiry = 'indef' | | obj.expiry = 'indef' |
| elseif effectiveExpiry ~= 'unknown' then | | elseif effectiveExpiry ~= 'unknown' then |
− | obj.expiry = validateDate(effectiveExpiry, 'expiry date') | + | obj.expiry = validateDate(effectiveExpiry, ' 截止時間') |
| end | | end |
| | | |
第138行: |
第134行: |
| obj.reason = mw.ustring.lower(args[1]) | | obj.reason = mw.ustring.lower(args[1]) |
| if obj.reason:find('|') then | | if obj.reason:find('|') then |
− | error('reasons cannot contain the pipe character ("|")', 3) | + | error(' 理由中不得存在「| 」!', 3) |
| end | | end |
| end | | end |
第144行: |
第140行: |
| -- Set protection date | | -- Set protection date |
| if args.date then | | if args.date then |
− | obj.protectionDate = validateDate(args.date, 'protection date') | + | obj.protectionDate = validateDate(args.date, ' 保護日期') |
| end | | end |
| | | |
第500行: |
第496行: |
| msg = explanations[action].default.default | | msg = explanations[action].default.default |
| else | | else |
| + | istalk = talkKey == 'talk' and true or false |
| error(string.format( | | error(string.format( |
− | 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"', | + | ' 找不到 action=%s protectionlevel=%s istalkpage=%s 時的解釋說明', |
| action, | | action, |
| level, | | level, |
− | talkKey | + | istalk |
| ), 8) | | ), 8) |
| end | | end |
第545行: |
第542行: |
| return pagetypes[self._protectionObj.title.namespace] | | return pagetypes[self._protectionObj.title.namespace] |
| or pagetypes.default | | or pagetypes.default |
− | or error('no default pagetype defined', 8) | + | or error(' 「pagetypes.default 」丟失!', 8) |
| end | | end |
| | | |
第560行: |
第557行: |
| msg = protectionBlurbs.edit.default | | msg = protectionBlurbs.edit.default |
| else | | else |
− | error('no protection blurb defined for protectionBlurbs.edit.default', 8) | + | error(' 沒有為「protectionBlurbs.edit.default 」定義保護說明!', 8) |
| end | | end |
| return self:_substituteParameters(msg) | | return self:_substituteParameters(msg) |
第586行: |
第583行: |
| msg = protectionLevels.edit.default | | msg = protectionLevels.edit.default |
| else | | else |
− | error('no protection level defined for protectionLevels.edit.default', 8) | + | error(' 沒有為「protectionLevels.edit.default 」定義保護級別!', 8) |
| end | | end |
| return self:_substituteParameters(msg) | | return self:_substituteParameters(msg) |
第648行: |
第645行: |
| if not key or not Blurb.bannerTextFields[key] then | | if not key or not Blurb.bannerTextFields[key] then |
| error(string.format( | | error(string.format( |
− | '"%s" is not a valid banner config field', | + | ' 「%s 」不是有效的橫幅配置金鑰。', |
| tostring(key) | | tostring(key) |
| ), 2) | | ), 2) |
第661行: |
第658行: |
| if type(msg) ~= 'string' then | | if type(msg) ~= 'string' then |
| error(string.format( | | error(string.format( |
− | 'bad output from banner config function with key "%s"' | + | ' 解析橫幅配置時生成錯誤「%s 」', |
− | .. ' (expected string, got %s)',
| |
| tostring(key), | | tostring(key), |
| type(msg) | | type(msg) |
第755行: |
第751行: |
| -- Renders the banner. | | -- Renders the banner. |
| makeMessageBox = makeMessageBox or require('Module:Message box').main | | makeMessageBox = makeMessageBox or require('Module:Message box').main |
− | local reasonText = self._reasonText or error('no reason text set', 2) | + | local reasonText = self._reasonText or error(' 沒有理由!', 2) |
| local explanationText = self._explanationText | | local explanationText = self._explanationText |
| local mbargs = { | | local mbargs = { |