Module:Lang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 142:
local title;
local tout = {};
local title_table = mw.loadData ('Module:Lang/data').translit_title_table; -- table of transliteration standards and the language codes and scripts that apply to those standards
table.insert (tout, "''<span title=\"");
Line 150:
table.insert (tout, ' transliteration');
elseif is_set (std) and is_set (script) then -- when both are specified
if title_table.[std.][script] then -- and legitimate
table.insert (tout, title_table.[std.][script]); -- add the appropriate text to the tool tip
else
return ''; -- one or both invalid, set up for an error message
end
elseif is_set (std) then -- script not set, use language code
if not title_table.[std] then return ''; end -- invalid standard, setupt for error message
if title_table.[std.][code] then
table.insert (tout, title_table.[std.][code]);
else -- code doesn't match
table.insert (tout, title_table.[std]['default']); -- so use the standard's default
end
else -- here if script set but std not set
if title_table['NO_STD'].[script] then
table.insert (tout, title_table['NO_STD'].[script]); -- use script if set
elseif title_table['NO_STD'].[code] then
table.insert (tout, title_table['NO_STD'].[code]); -- use language code
else
table.insert (tout, language_name); -- write a generic tool tip
Line 286:
table.insert (out, translit);
else
table.insert (out, '<span style="font-size:100%" class="error">error: invalid translit std or script</span>');
end
end
Anonymous user