Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Multilingual description

From Neodyland Wiki
Revision as of 22:11, 27 February 2014 by commons>Rillke (mimic logic of Template:Mld + allowing all supported language codes)
Module documentation[ create · purge ]
local p = {}

function p.mld(frame)
	local args, pargs = frame.args, ( frame:getParent() or {} ).args or {}
	local sorting = require('Module:Multilingual description/sort')
	local processed = {}
	local ret = {}
	
	for k, v in pairs( sorting ) do
		if pargs[v] then
			table.insert(ret, '{{ls|' .. v .. '|' .. pargs[v] .. '|classes=description}}')
		end
		processed[v] = 1
	end

	for k, v in pairs( pargs ) do
		if not processed[k] and mw.language.isSupportedLanguage(k) then
			table.insert(ret, '{{ls|' .. k .. '|' .. v .. '|classes=description}}')
		end
	end

	return frame:preprocess(table.concat(ret))
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.