Module:Lang/utilities: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(2 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 158 ⟶ 162:
return error_msg_make ('invalid language tag: <span style="font-family: monospace, monospace;">' .. tag .. '</span>; IETF format not supported', template_name, nocat);
end
iflocal notis_latn, pos = unicode.is_Latin (text1) then;
if not is_latn then
return error_msg_make ('<span style="font-family: monospace, monospace;">&lt;' .. ((err_texts[template_name:lower()] and 'text2') or 'text1') .. '></span> is not Latin script (pos ' .. pos .. ')', template_name, nocat);
end
ifis_latn, pos = unicode.is_Latin (text2) then;
if is_latn then
return error_msg_make ('<span style="font-family: monospace, monospace;">&lt;' .. ((err_texts[template_name:lower()] and 'text1') or 'text2') .. '></span> is Latin script (pos ' .. pos .. ')', template_name, nocat);
end