Module:Lang: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (159 revisions imported: infobox)
(sync from sandbox;)
Line 601: Line 601:
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
if is_set (code) then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
if not style then -- nil for is the default italic style
if not style then -- nil for the default italic style
table.insert (tout, "<i lang=\""); -- so use <i> tag
table.insert (tout, "<i lang=\""); -- so use <i> tag
else
else
Line 619: Line 619:
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
table.insert (tout, '-language') -- skip this text (individual and macro languages only)
end
end
table.insert (tout, ' transliteration'); -- finish the tool tip
table.insert (tout, ' romanization'); -- finish the tool tip; use romanization when neither script nor standard supplied
elseif is_set (std) and is_set (tscript) then -- when both are specified
elseif is_set (std) and is_set (tscript) then -- when both are specified
if title_table[std] then -- and if standard is legitimate
if title_table[std] then -- and if standard is legitimate
Line 660: Line 660:
table.insert (tout, '">');
table.insert (tout, '">');
table.insert (tout, translit);
table.insert (tout, translit);
if is_set (code) and not style then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
if is_set (code) and not style then -- when a language code is provided (always with {{lang-xx}} templates, not always with {{transl}})
table.insert (tout, "</i>"); -- close the italic tag
table.insert (tout, "</i>"); -- close the italic tag
else
else
Line 801: Line 801:
<includeonly>{{#invoke:lang|lang}}</includeonly>
<includeonly>{{#invoke:lang|lang}}</includeonly>


parameters are recieved from the template's frame (parent frame)
parameters are received from the template's frame (parent frame)


]]
]]
Line 898: Line 898:
<includeonly>{{#invoke:lang|lang}}</includeonly>
<includeonly>{{#invoke:lang|lang}}</includeonly>


parameters are recieved from the template's frame (parent frame)
parameters are received from the template's frame (parent frame)


]]
]]
Line 1,107: Line 1,107:
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
translit_title = mw.title.makeTitle (0, table.concat ({'Romanization of ', translit_script_name})); -- make a title object
if translit_title.exists and ('no' ~= args.link) then
if translit_title.exists and ('no' ~= args.link) then
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'translit.')); -- make a wikilink if there is an article to link to
table.insert (out, make_wikilink ('Romanization of ' .. translit_script_name or language_name, 'romanized') .. ':'); -- make a wikilink if there is an article to link to
else
else
table.insert (out, '<abbr title="transliteration">translit.</abbr>'); -- else define the abbreviation
-- table.insert (out, '<abbr title="transliteration">translit.</abbr>'); -- else define the abbreviation
table.insert (out, 'romanized:'); -- else define the abbreviation
end
end
table.insert (out, '&nbsp;</small>'); -- close the small tag
table.insert (out, '&nbsp;</small>'); -- close the small tag