Content deleted Content added
No edit summary |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 6:
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
local err_texts = { -- because wrapper templates have Latn/non-Latn text ordered according to the wrapper template's name
['lang-sh-cyrl-latn'] = true, -- this template has |1=cyrl script |2=latn script
}
Line 14 ⟶ 18:
]]
local function error_msg_make (msg, template,
local out = {};
local category = 'Lang and lang-xx';
table.insert (out, table.concat ({'<span style=\"color:#d33\">Error: <span style="font-family: monospace, monospace;">{{', template, '}}</span>: '}));
table.insert (out, msg);
table.insert (out, table.concat ({' ([[Template:
table.insert (out, '</span>');
Line 153 ⟶ 157:
if not (tag and text1 and text2) then
return error_msg_make ('missing a required argument', template_name,
end
if tag:find ('-', 1, true) then
return error_msg_make ('invalid language tag: <
end
if not is_latn then
return error_msg_make ('<span style="font-family: monospace, monospace;"><' .. ((err_texts[template_name:lower()] and 'text2') or 'text1') .. '></span> is not Latin script (pos ' .. pos .. ')', template_name, nocat);
end
if is_latn then
return error_msg_make ('<span style="font-family: monospace, monospace;"><' .. ((err_texts[template_name:lower()] and 'text1') or 'text2') .. '></span> is Latin script (pos ' .. pos .. ')', template_name, nocat);
end
|