Module:Lang: Difference between revisions
Content deleted Content added
Caleb Cooper (talk | contribs) m 1 revision imported |
per CfD; |
||
Line 127:
if count > 1 then -- return nil and an error message if more than one is set
return nil, 'only one of
end
Line 412:
local category;
if '
category = '
else
category = '
end
table.insert (out, table.concat ({'
table.insert (out, table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">Error: {{', template, '}}: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[:Category:', category, ' template errors|help]])'}));
Line 517:
if 'normal' == style then -- when |italic=no
table.insert (html, ' style=\"font-style: normal;'); -- override external markup, if any
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
Line 523:
if is_set (size) then -- when |size=<something>
if is_set (style_added) then
table.insert (html, table.concat ({' font-size: ', size, ';'})); -- add when style attribute already inserted
else
table.insert (html, table.concat ({' style=\"font-size: ', size, ';'})); -- create style attribute
style_added = '\"'; -- remember that style attribute added and is not yet closed
end
Line 561:
for ISO 639-2 collective languages (and for 639-1 bh):
[[Category:Articles with text
]=]
Line 574:
if language_name:find ('languages') then
return table.concat ({'[[Category:Articles with text
end
Line 619 ⟶ 618:
table.insert (tout, "<i lang=\""); -- so use <i> tag
else
table.insert (tout, table.concat ({'<span style=\"font-style: ', style, '\" lang=\"'})); -- non-standard style, construct a span tag for it
end
table.insert (tout, code);
Line 724 ⟶ 723:
if 0 < #maint_msgs then -- when there are maintenance messages
table.insert (maint, table.concat ({'<span class="lang-comment" style="font-style: normal; display: none; color: #33aa33; margin-left: 0.3em;">'})); -- opening <span> tag
for _, msg in ipairs (maint_msgs) do
table.insert (maint, table.concat ({msg, ' '})); -- add message strings
Line 891 ⟶ 890:
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or '
validate_cat_args (args); -- determine if categorization should be suppressed
if args[1] and args.code then
return make_error_msg ('conflicting: {{{1}}} and
else
args.code = args[1] or args.code; -- prefer args.code
Line 902 ⟶ 901:
if args[2] and args.text then
return make_error_msg ('conflicting: {{{2}}} and
else
args.text = args[2] or args.text; -- prefer args.text
Line 918 ⟶ 917:
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid
end
Line 1,052 ⟶ 1,051:
local msg; -- for error messages
local tag = 'span'; -- initial value for make_text_html()
local template = args.template or '
if args[1] and args.text then
return make_error_msg ('conflicting: {{{1}}} and
else
args.text = args[1] or args.text; -- prefer args.text
Line 1,068 ⟶ 1,067:
if args[2] and args.translit then
return make_error_msg ('conflicting: {{{2}}} and
else
args.translit = args[2] or args.translit -- prefer args.translit
Line 1,074 ⟶ 1,073:
if args[3] and (args.translation or args.lit) then
return make_error_msg ('conflicting: {{{3}}} and
elseif args.translation and args.lit then
return make_error_msg ('conflicting:
else
args.translation = args[3] or args.translation or args.lit; -- prefer args.translation
Line 1,082 ⟶ 1,081:
if args.links and args.link then
return make_error_msg ('conflicting:
else
args.link = args.link or args.links; -- prefer args.link
Line 1,124 ⟶ 1,123:
args.proto, msg = validate_proto (args.proto); -- return boolean, or nil, or nil and error message flag
if msg then
return make_error_msg (table.concat ({'invalid
end
Line 1,341 ⟶ 1,340:
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">
end
Line 1,405 ⟶ 1,404:
template = table.concat ({'{{', args['template'], '}}: '}); -- make template name (if provided by the template)
end
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">
end
Line 1,451 ⟶ 1,450:
if not title_table[args.translit_std] then
return make_error_msg (table.concat ({'unrecognized transliteration standard: ', args.translit_std}), args, '
end
else
Line 1,458 ⟶ 1,457:
else
if args[1] and args[1]:match ('^%a%a%a?%a?$') then -- args[2] missing; is args[1] a code or its it the transliterated text?
return make_error_msg ('no text', args, '
else
args.text = args[1]; -- args[1] is not a code so we're missing that; assign args.text for error message
return make_error_msg ('missing language / script code', args, '
end
end
Line 1,470 ⟶ 1,469:
args.code = args[1]:lower(); -- use the language/script code; only (2, 3, or 4 alpha characters); lower case because table indexes are lower case
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args[1]}), args, '
end
else
return make_error_msg ('missing language / script code', args, '
end
args.italic, msg = validate_italic (args);
if msg then
return make_error_msg (msg, args, '
end
Line 1,496 ⟶ 1,495:
args.code = ''; -- unset because not a language code
else
return make_error_msg (table.concat ({'unrecognized language / script code: ', args.code}), args, '
end
-- here only when all parameters passed to make_translit() are valid
Line 1,536 ⟶ 1,535:
if msg then
local template = (args['template'] and table.concat ({'{{', args['template'], '}}: '})) or ''; -- make template name (if provided by the template)
return table.concat ({'<span style=\"font-size: 100%; font-style: normal;\" class=\"error\">
end
| |||