Module:PageContentLanguage: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
Goraf (talk | contribs)
for test with content language
 
Goraf (talk | contribs)
test: code to display passed language code
 
Line 1: Line 1:
local getArgs = require('Module:Arguments').getArgs
local p = {}
local p = {}
 
function p.main()
function p.main(frame)
local code = mw.language.getContentLanguage():getCode()
local args = getArgs(frame)
return p._main(args)
end
function p._main(args)
local lang = args.lang
return "Page content language is: " .. code
return 'PageLang is: ' .. lang
end
end
 
return p
return p

Latest revision as of 22:05, 30 November 2015

Module documentation[create]
local getArgs = require('Module:Arguments').getArgs
local p = {}
 
function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end
 
function p._main(args)
	local lang = args.lang
	
	return 'PageLang is: ' .. lang
end
 
return p