Module:User:Trappist the monk/Name in various languages
Appearance
Module rating is invalid or not specified. |
Usage
[edit]{{#invoke:User:Trappist the monk/Name in various languages|function_name}}
{{#invoke:User:Trappist_the_monk/Name in various languages|main
| name = Name in official languages
| bg = Съвет на Европейския съюз
| hr = Vijeće Europske unije
| cs = Rada Evropské unie
| da = Rådet for Den Europæiske Union
| nl = Raad van de Europese Unie
| et = Euroopa Liidu Nõukogu
| fi = Euroopan unionin neuvosto
| fr = Conseil de l'Union européenne
| de = Rat der Europäischen Union
| el = Συμβούλιο της Ευρωπαϊκής Ένωσης
| hu = Az Európai Unió Tanácsa
| ga = Comhairle an Aontais Eorpaigh
| it = Consiglio dell'Unione europea
| lv = Eiropas Savienības Padome
| lt = Europos Sąjungos Taryba
| mt = Kunsill tal-Unjoni Ewropea
| pl = Rada Unii Europejskiej
| pt = Conselho da União Europeia
| ro = Consiliul Uniunii Europene
| sk = Rada Európskej únie
| sl = Svet Evropske unije
| es = Consejo de la Unión Europea
| sv = Europeiska unionens råd
}}
Name in official languages | |
---|---|
Bulgarian: | Съвет на Европейския съюз |
Croatian: | Vijeće Europske unije |
Czech: | Rada Evropské unie |
Danish: | Rådet for Den Europæiske Union |
Dutch: | Raad van de Europese Unie |
Estonian: | Euroopa Liidu Nõukogu |
Finnish: | Euroopan unionin neuvosto |
French: | Conseil de l'Union européenne |
German: | Rat der Europäischen Union |
Greek: | Συμβούλιο της Ευρωπαϊκής Ένωσης |
Hungarian: | Az Európai Unió Tanácsa |
Irish: | Comhairle an Aontais Eorpaigh |
Italian: | Consiglio dell'Unione europea |
Latvian: | Eiropas Savienības Padome |
Lithuanian: | Europos Sąjungos Taryba |
Maltese: | Kunsill tal-Unjoni Ewropea |
Polish: | Rada Unii Europejskiej |
Portuguese: | Conselho da União Europeia |
Romanian: | Consiliul Uniunii Europene |
Slovak: | Rada Európskej únie |
Slovene: | Svet Evropske unije |
Spanish: | Consejo de la Unión Europea |
Swedish: | Europeiska unionens råd |
local get_args = require ('Module:Arguments').getArgs;
local lang_mod = require('Module:Lang')
--[[--------------------------< M A I N >----------------------------------------------------------------------
]]
local function main (frame)
local args_t = get_args (frame);
local raw_rows_t = {};
local width = table.concat ({'width:', args_t.width or '100%', ';'});
local font_size = table.concat ({'font-size:', args_t.font_size or '88%', ';'});
local name = args_t.name;
for tag, param_value in pairs (args_t) do
if lang_mod._is_ietf_tag (tag) then -- if tag is a valid language tag
local language_link = lang_mod._name_from_tag ({tag, ['link'] = 'yes'});
local official_name = lang_mod._lang ({tag, param_value});
table.insert (raw_rows_t, table.concat ({ -- build a basic row
'| style=\"padding-left:0.5em\" | ', -- indent style same for each row
language_link, -- language link in the 'language column'
': || ', -- column separator
official_name, -- offical name in the official name column
})
);
end
end
table.sort (raw_rows_t); -- ascending sort because pairs() doesn't obey template parameter order
local output_t = {}; -- final output collected here
local header_t = {}; -- wikitable header stuff collected here
table.insert (header_t, '{| class="mw-collapsible mw-collapsed"'); -- open wikitable as collapsed
table.insert (header_t, 'style="'); -- begin table styling
table.insert (header_t, width); -- set width
table.insert (header_t, font_size); -- set font_size
table.insert (header_t, 'text-align:left; border-collapse:collapse;"'); -- finish table styling
table.insert (output_t, table.concat (header_t)); -- concatenate into a big string and save
if name then
table.insert (output_t, table.concat ({ -- build a 2-column header; shouldn't this properly be a caption for accessibility?
'! colspan=2 style="text-align:center; border-top: 0px;" | ', -- styling
name, -- and name
'\n|- style="border-bottom:1px solid #aaa"' -- add a bottom boarder
}));
end
table.insert (output_t, table.concat (raw_rows_t, '\n|- style="border-bottom:1px solid #aaa"\n')); -- make a big string of row data
table.insert (output_t, '|}'); -- close the wikitable
return table.concat (output_t, '\n'); -- make a damn big string and done
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
main = main
}