Module:Engvar/detect explained

local engvar_template_patterns = ;

local function get_lang_var(pagename) local title_object = pagename and mw.title.new(pagename) or mw.title.getCurrentTitle; local content; if 10 ~= title_object.namespace and 828 ~= title_object.namespace then -- all namespaces except Template and Module content = title_object:getContent or ; -- get the content of the article or ; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625 end

if (not content or content

) then return nil; end for pattern, var in pairs (engvar_template_patterns) do -- loop through the patterns looking for,, etc., or any of their redirects if content:find(pattern) then return var; end end return nil;end

return