Module:Lang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 344:
--[[--------------------------< L A N G >----------------------------------------------------------------------
 
<includeonly>{{#invoke:lang|lang|code={{{1|}}}|text={{{2|}}}|rtl={{{rtl|}}}|italic={{{italic|}}}|size={{{size|}}}|nocat={{{nocat|}}}}}</includeonly>
 
|code = the BCP47 language code
Line 369:
end
 
if args.text:matchnot is_set ("\'\'[^\']+\'\'"args.italic) then
args.italic = 'no'; -- DEFAULT for {{lang}} templates is to not italicize
return make_error_msg ('lang: text has italic markup', args.no_cat);
end
 
if args.text:match ("%f[\']\'\'[^\']+\'\'%f[^\']") or args.text:match ("\'\'\'\'\'[^\']+\'\'\'\'\'") then -- italic but not bold or bold italic
return make_error_msg ('lang-xx: text has italic markup', args.no_cat);
end
Line 381 ⟶ 385:
end
 
table.insert (out, make_text_span (args.code, args.text, args.rtl, nilargs.italic, args.size)); -- italics set to nil here because not supported by {{lang}}
table.insert (out, make_category (args.code, language_name, args.nocat));
return table.concat (out); -- put it all together and done
Line 431 ⟶ 435:
end
 
if args.text:match ("%f[\']\'\'[^\']+\'\'%f[^\']") or args.text:match ("\'\'\'\'\'[^\']+\'\'\'\'\'") then -- italic but not bold or bold italic
return make_error_msg ('lang-xx: text has italic markup', args.no_cat);
end
Anonymous user