mw.getContentLanguage().code -- Returns the content language.
mw.getCurrentFrame():preprocess("{{PAGELANGUAGE}}") -- Returns the page language.
mw.getCurrentFrame():preprocess( "{{int:Lang}}" ) -- Returns the user language.
@daniel and I were chatting about this earlier. Looks like some kind of hidden magic function is able to provide the language of the user in Lua instead of using {{int:Lang}}. Get it to work and switch all modules in the module namespace on Commons to use it