Content deleted Content added
more localization; bda + dda use $1/$2/$3 substitutes so wanted wikitext can be specified |
more localization for bnwiki + bswiki |
||
Line 31:
['txt-comma-and'] = ', and ',
['txt-error'] = 'Error: ',
['txt-format-default'] = 'mf', -- 'df' (day first = dmy) or 'mf' (month first = mdy)
['txt-module-convertnumeric'] = 'Module:ConvertNumeric',
['txt-module-date'] = 'Module:Date',
Line 37:
['txt-bda'] = '<span style="display:none"> (<span class="bday">$1</span>) </span>$2<span class="noprint ForceAgeToShow"> (age $3)</span>',
['txt-dda'] = '$2<span style="display:none">($1)</span> (aged $3)',
['txt-bda-disp'] = 'disp_raw', -- disp_raw → age is a number only; disp_age → age is a number and unit (normally years but months or days if very young)
['txt-dda-disp'] = 'disp_raw',
['txt-dmy'] = '%-d %B %-Y',
['txt-mdy'] = '%B %-d, %-Y',
}
['mt-bad-param1'] = true,
}
Line 112 ⟶ 120:
local function dateFormat(args)
-- Return string for wanted date format.
local default = mtext['txt-format-default']
local other = default == 'df' and 'mf' or 'df'
local wanted = stripToNil(args[other]) and other or default
return wanted == 'df' and mtext['
end
Line 122 ⟶ 130:
return mw.message.newRawMessage(text, ...):plain()
end
local function yes(parameter)
-- Return true if parameter should be interpreted as "yes".
Line 129 ⟶ 138:
end
local function message(msg,
-- Return formatted message text for an error or warning.
local function getText(msg)
return mtext[msg] or error('Bug: message "' .. tostring(msg) .. '" not defined')
end▼
local text▼
▲ local rep = {}
end
local categories = {
Line 151 ⟶ 147:
warning = mtext['txt-category'],
}
local a, b, k, category
local text = substituteParameters(getText(msg), ...)
if id == 'warning' then▼
if isWarning[msg] then
a = '<sup>[<i>'
b = '</i>]</sup>'
else
a = '<strong class="error">' .. getText('txt-error')
b = '</strong>'
k = 'error'
end
if mw.title.getCurrentTitle():inNamespaces(0) then
-- Category only in namespaces: 0=article.
category = '[[' .. categories[
end
return
Line 248 ⟶ 247:
result = '<span data-sort-value="_SORTKEY_♠"></span>'
end
return (result:gsub('_SORTKEY_', sortKey))
end
end
Line 351 ⟶ 350:
date = date + item
if not date then
return message(
end
end
Line 408 ⟶ 407:
local name = names[components[i]]
if name then
name = mw.getContentLanguage():plural(islist and v[2] or v, name text:add(vstr .. sep .. name)
else
text:add(vstr)
Line 456 ⟶ 458:
-- which have been validated.
local names = {
-- Each name is
-- * a string if no plural form of the name is used; or
-- https://translatewiki.net/wiki/Plural/Mediawiki_plural_rules▼
-- * a table of strings, one of which is selected using the rules at
▲ -- https://translatewiki.net/wiki/Plural/Mediawiki_plural_rules
abbr_off = {
sep = ' ',
Line 469 ⟶ 473:
},
abbr_on = {
y =
m =
w =
d =
H =
M =
S =
},
abbr_infant = { -- for {{age for infant}}
Line 566 ⟶ 570:
(textOptions.suffix or '')
end
return message(
end
Line 877 ⟶ 881:
return message('mt-invalid-bd-age')
end
local disp
if diff.years < 2 then
disp = 'disp_age'
Line 926 ⟶ 931:
end
if invalid then
result = result .. message(
end
end
Line 983 ⟶ 988:
show = 'y',
abbr = 'abbr_off',
disp = mtext['
range = 'dash',
sep = 'sep_space',
Line 1,010 ⟶ 1,015:
end
if invalid then
result = result .. message(
end
end
Line 1,082 ⟶ 1,087:
parm = translate[parm]
if parm == nil then -- test for nil because false is a valid setting
return message(
end
parms[argname] = parm
Line 1,093 ⟶ 1,098:
if show then
if show.id ~= round then
return message(
end
else
|