From: Mike Taylor Date: Fri, 2 May 2014 15:56:11 +0000 (+0100) Subject: Move the M function (translation) from mkws-team.js to mkws-core.js, X-Git-Tag: 1.0.0~743 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=786df90e4660d81758117eb1f12f6ad89ec3fc4b Move the M function (translation) from mkws-team.js to mkws-core.js, since it's not team-specific (and never really was). --- 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;