From: Mike Taylor Date: Tue, 29 Apr 2014 12:53:14 +0000 (+0100) Subject: Move function mkwsSetLang() to the end of the team object, where it's used. X-Git-Tag: 1.0.0~803 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=e562c8bf93ae0cb4e865bac6b75d3e515d94d427 Move function mkwsSetLang() to the end of the team object, where it's used. --- 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;