Content deleted Content added
update based on sandbox |
per edit request at Template talk:English variant notice#Edit request 16 August 2025 - remove unnecessary text |
||
(14 intermediate revisions by 9 users not shown) | |||
Line 1:
local p = {}
local categoryHandler = require( 'Module:Category handler' ).main
Line 13 ⟶ 12:
n = mArguments.getArgs(frame, {parentFirst = true})
n.variant = n.variant or templatetitle --automatically use title generated from template name
if n.doc ~= 'no' then
return frame:expandTemplate {title = 'English variant notice/documentation', args = n} end
end
return p._main (frame, templatetitle)
Line 44 ⟶ 45:
bOxford = yesno(n.Oxford)
bIUPAC = yesno(n.IUPAC)
chemtext = "; ''aluminium'', ''sulfur''
if bOxford then
n.spelling_examples = "''colour'', ''realize'', ''organization'', ''analyse''; note that '''-ize''' is used instead of -ise"
Line 59 ⟶ 60:
elseif bIUPAC then
n.extravariant = ' with [[IUPAC]] spelling'
n.spelling_examples = n.spelling_examples and n.spelling_examples..chemtext or "''aluminium'', ''sulfur''
p.IUPAC ()
return
Line 75 ⟶ 76:
function p.base_text (frame)
n.subjectspace =
n.spelling_examples = n.spelling_examples and string.format(' (%s)', n.spelling_examples) or ''
n.terms = n[1] or n.terms
n.terms = n.terms and string.format('
n.compare = n.compare and (n.compare..' ') or ''
n.text = string.format([=[This %s is '''written in [[%s]]%s'''%s%s
n.subjectspace, n.variant, n.extravariant, n.spelling, n.spelling_examples, n.terms, n.compare, n.extraguide)
end
Line 86 ⟶ 87:
function p.style (frame)
local size
if yesno(n.small) then size = '30px'
elseif n.size then size = n.size
else size = '50px'
end
if n.image then
if n.flag == nil or yesno(n.flag) then
Line 104 ⟶ 108:
--categorize editnotice if specified
if yesno(n.editnotice_cat) then
p.cat(string.format('Pages with
end
return frame:expandTemplate{title = 'editnotice', args = n}
|