Module:In lang/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 67:
 
local module = 'Module:Lang' .. (frame:getTitle():match ('/sandbox') or ''); -- if this module is the sandbox,
local name_from_codename_from_tag = require (module)._name_from_code_name_from_tag; -- use Module:Lang/sandbox; Module:Lang else
 
local namespace = mw.title.getCurrentTitle().namespace; -- used for categorization
Line 77:
for i, lang in ipairs (args) do
local t = {args[i], ['link'] = args['link'], ['template'] = args['template']}; -- build an 'args' table
lang = name_from_codename_from_tag (t) -- get the language name
table.insert (list, lang) -- add this language or error message to the list
 
Line 98:
local result = {'<span class="languageicon">('}; -- opening span and (
table.insert (result, 'yes' == args['cap'] and 'In ' or 'in '); -- add capitalized or uncapitalized 'in'
table.insert (result, mw.text.listToText (list, ', ', (2 < #list) and ', and ' or ' and ' )); -- addand concatenated the language list
 
table.insert (result, ')</span>'); -- add closing ) and closing span