From 786df90e4660d81758117eb1f12f6ad89ec3fc4b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 2 May 2014 16:56:11 +0100 Subject: [PATCH] Move the M function (translation) from mkws-team.js to mkws-core.js, since it's not team-specific (and never really was). --- src/mkws-core.js | 11 +++++++++++ src/mkws-team.js | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 7d5128e..87c1caf 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -97,6 +97,17 @@ mkws.log = function(string) { }; +// Translation function. +mkws.M = function (word) { + var lang = mkws.config.lang; + + if (!lang || !mkws.locale_lang[lang]) + return word; + + return mkws.locale_lang[lang][word] || word; +}; + + // This function is taken from a StackOverflow answer // http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript/901144#901144 mkws.getParameterByName = function(name) { diff --git a/src/mkws-team.js b/src/mkws-team.js index 4d1c3a3..d50e93f 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -341,18 +341,6 @@ function team($, teamName) { }; - // Translation function. - mkws.M = function (word) { - var lang = mkws.config.lang; - log("in M('" + word + "'), lang=" + lang); - - if (!lang || !mkws.locale_lang[lang]) - return word; - - return mkws.locale_lang[lang][word] || word; - }; - - // Finds the node of the specified class within the current team function findnode(selector, teamName) { teamName = teamName || m_teamName; -- 1.7.10.4