Module:Lang: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 172:
]=]
 
local function make_error_msg (msg, nocat)
local out = {};
Line 178:
table.insert (out, msg);
table.insert (out, '</span>');
-- if (0 ~= namespace) or nocat then -- only categorize in article space
table.insert (out, '[[Category:lang and lang-xx template errors]]');
-- end
 
return table.concat (out);
Line 333 ⟶ 338:
local code, script, region, variant = get_ietf_parts (args.code);
-- if is_set (code) then
-- if lang_data.override[code] then
-- language_name = lang_data.override[code][1]
-- elseif lang_name_table.lang[code] then
-- language_name = lang_name_table.lang[code][1]; -- table entries sometimes have multiple names, always take the first one
-- end
-- end
-- if not is_set (language_name) then
if not (code and script and region and variant) then
table.insert (out, make_error_msg (table.concat ({'lang: unknown language code: ', args.code or 'missing'}), args.no_cat));
-- if 0 ~= namespace then -- only categorize in article space
-- table.insert (out, '[[Category:Articleslang containingand unknown languagelang-xx template codeserrors');
-- if is_set (args.code) then
-- table.insert (out, '|' .. args.code); -- add a sort key
-- end
-- table.insert (out, ']]');
-- end
return table.concat (out); -- emit an error message and category
end
Line 403 ⟶ 399:
local translit_title;
-- if is_set (code) then
-- if lang_data.override[code] then
-- language_name = lang_data.override[code][1]
-- elseif lang_name_table.lang[code] then
-- language_name = lang_name_table.lang[code][1]; -- table entries sometimes have multiple names, always take the first one
-- end
-- end
 
-- if not is_set (language_name) then
if not (code and script and region and variant) then
table.insert (out, make_error_msg (table.concat ({'lang-xx: unknown language code: ', args.code or 'missing'}), args.nocat));
-- if 0 ~= namespace then -- only categorize in article space
-- table.insert (out, '[[Category:Articleslang containingand unknown languagelang-xx template codeserrors');
-- if is_set (args.code) then
-- table.insert (out, '|' .. args.code); -- add a sort key
-- end
-- table.insert (out, ']]');
-- end
return table.concat (out); -- emit an error message and category
end
Line 445 ⟶ 432:
table.insert (out, ', <small>');
translit_title = mw.title.makeTitle (0, 'Romanization of ' .. language_name)
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script or language_name, 'translit.'));
else
Line 455 ⟶ 442:
table.insert (out, translit);
else
-- table.insert (out, '<spanmake_error_msg style="font(table.concat ({'lang-size:100%" class="error">errorxx: invalid translit std: \'', args.std or 'missing', '\' or script</span>: \'', args.script or 'missing', '\''}), args.nocat));
table.insert (out, make_error_msg (table.concat ({'invalid translit std: \'', args.std or 'missing', '\' or script: \'', args.script or 'missing', '\''})));
end
end
Line 462 ⟶ 448:
if is_set (args.lit) then -- translation (not supported in {{lang}})
table.insert (out, ', <small>');
if 'no' == args.link then
table.insert (out, make_wikilink ('Literal translation', 'lit.'));
table.insert (out, '<abbr title="literal translation">lit.</abbr>');
else
table.insert (out, make_wikilink ('Literal translation', 'lit.'));
-- end
table.insert (out, "&nbsp;</small>'");
table.insert (out, args.lit);
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu