From e562c8bf93ae0cb4e865bac6b75d3e515d94d427 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 29 Apr 2014 13:53:14 +0100 Subject: [PATCH] Move function mkwsSetLang() to the end of the team object, where it's used. --- src/mkws-team.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/mkws-team.js b/src/mkws-team.js index 6d1e5a8..01d79b8 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -341,19 +341,6 @@ function team($, teamName) { }; - function mkwsSetLang() { - var lang = mkws.getParameterByName("lang") || m_config.lang; - if (!lang || !mkws.locale_lang[lang]) { - m_config.lang = "" - } else { - m_config.lang = lang; - } - - log("Locale language: " + (m_config.lang ? m_config.lang : "none")); - return m_config.lang; - } - - // Translation function. At present, this is properly a // global-level function (hence the assignment to mkws.M) but we // want to make it per-team so different teams can operate in @@ -463,6 +450,20 @@ function team($, teamName) { return m_widgets[type]; } + + function mkwsSetLang() { + var lang = mkws.getParameterByName("lang") || m_config.lang; + if (!lang || !mkws.locale_lang[lang]) { + m_config.lang = "" + } else { + m_config.lang = lang; + } + + log("Locale language: " + (m_config.lang ? m_config.lang : "none")); + return m_config.lang; + } + + mkwsSetLang(); return that; -- 1.7.10.4