Module:Lang: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 362: Line 362:
if not (code and script and region and variant) then
if not (code and script and region and variant) then
return make_error_msg (table.concat ({'lang: unknown language code: ', args.code or 'missing'}), args.no_cat);
return make_error_msg (table.concat ({'{{lang}}: unknown language code: ', args.code or 'missing'}), args.no_cat);
end
end
if not is_set (args.text) then
if not is_set (args.text) then
return make_error_msg ('lang: no text', args.no_cat);
return make_error_msg ('{{lang}}: no text', args.no_cat);
end
end


Line 374: Line 374:


if args.text:match ("%f[\']\'\'[^\']+\'\'%f[^\']") or args.text:match ("\'\'\'\'\'[^\']+\'\'\'\'\'") then -- italic but not bold or bold italic
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);
return make_error_msg ('{{lang-xx}}: text has italic markup', args.no_cat);
end
end
Line 428: Line 428:
if not (code and script and region and variant) then
if not (code and script and region and variant) then
return make_error_msg (table.concat ({'lang-xx: unknown language code: ', args.code or 'missing'}), args.no_cat);
return make_error_msg (table.concat ({'{{lang-xx}}: unknown language code: ', args.code or 'missing'}), args.no_cat);
end
end
if not is_set (args.text) then
if not is_set (args.text) then
return make_error_msg ('lang-xx: no text', args.no_cat);
return make_error_msg ('{{lang-xx}}: no text', args.no_cat);
end
end


if args.text:match ("%f[\']\'\'[^\']+\'\'%f[^\']") or args.text:match ("\'\'\'\'\'[^\']+\'\'\'\'\'") then -- italic but not bold or bold italic
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);
return make_error_msg ('{{lang-xx}}: text has italic markup', args.no_cat);
end
end
Line 471: Line 471:
table.insert (out, translit);
table.insert (out, translit);
else
else
return make_error_msg (table.concat ({'lang-xx: invalid translit std: \'', args.std or 'missing', '\' or script: \'', args.script or 'missing', '\''}), args.nocat);
return make_error_msg (table.concat ({'{{lang-xx}}: invalid translit std: \'', args.std or 'missing', '\' or script: \'', args.script or 'missing', '\''}), args.nocat);
end
end
end
end