Module:Lang: Difference between revisions

synch from sandbox;
No edit summary
(synch from sandbox;)
Line 235:
elseif source:match ('^%a%a%a?%-%a%a%-[%a%d][%a%d][%a%d][%a%d][%a%d]+$') then -- ll-RR-variant (where variant is 5-8 alnum characters)
code, region, variant = source:match ('^(%a%a%a?)%-(%a%a)%-([%a%d][%a%d][%a%d][%a%d][%a%d][%a%d]?[%a%d]?[%a%d]?)$');
elseif source:match ('^%a%a%a?%-%d%d%d%-[%a%d][%a%d][%a%d][%a%d][%a%d]+$') then -- ll-DDD-variant (where region is 3 digits; variant is 45-8 digitsalnum characters)
code, region, variant = source:match ('^(%a%a%a?)%-(%d%d%d)%-([%a%d][%a%d][%a%d][%a%d][%a%d][%a%d]?[%a%d]?[%a%d]?)$');
 
Line 541:
table.insert (tout, "<span title=\""); -- when no language code: no lang= attribute, not italic ({{transl}} only)
end
std = std and std:lower(); -- lower case for table indexing
if not is_set (std) and not is_set (tscript) then -- when neither standard nor script specified
table.insert (tout, language_name); -- write a generic tool tip
if not language_name:find ('languages') then -- collective language names (plural 'languages' is part of the name)
table.insert (tout, '-language transliteration');
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, '-language transliteration'); -- finish the tool tip
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_table[std] then -- and if standard is legitimate
Line 565 ⟶ 570:
end
else -- here if translit-script set but translit-std not set
if title_table['NO_STDno_std'][tscript] then
table.insert (tout, title_table['NO_STDno_std'][tscript]); -- use translit-script if set
elseif title_table['NO_STDno_std'][code] then
table.insert (tout, title_table['NO_STDno_std'][code]); -- use language code
else
if is_set (tscript) then
table.insert (tout, table.concat ({language_name, '-script transliteration'})); -- write a script tool tip
elseif is_set (code) then
table.insertif (tout, table.concatnot ({language_name,:find ('-language transliterationlanguages'})); then -- write acollective language toolnames tip(plural 'languages' is part of the name)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
table.insert (tout, ' transliteration'); -- finish the tool tip
else
table.insert (tout, ' transliteration'); -- generic tool tip (can we ever get here?)
Anonymous user