Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:User:Trappist the monk/Name in various languages
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
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 }
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Error
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Pp
(
edit
)
Template:Protection padlock
(
edit
)
Template:Sandbox other
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Module:Arguments
(
edit
)
Module:Error
(
edit
)
Module:File link
(
edit
)
Module:Lang
(
edit
)
Module:Message box
(
edit
)
Module:Protection banner
(
edit
)
Module:String
(
edit
)
Module:Unicode data
(
edit
)
Module:User:Trappist the monk/Name in various languages
(
edit
)
Module:User:Trappist the monk/Name in various languages/doc
(
edit
)