Move code to set language from command line out of mkws-team.js into
authorMike Taylor <mike@indexdata.com>
Fri, 2 May 2014 16:10:03 +0000 (17:10 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 2 May 2014 16:10:03 +0000 (17:10 +0100)
mkws-core.js

src/mkws-core.js
src/mkws-team.js

index 87c1caf..1e84fca 100644 (file)
@@ -466,6 +466,15 @@ mkws.pagerNext = function(tname) {
            }
        }
 
+        var lang = mkws.getParameterByName("lang") || mkws.config.lang;
+        if (!lang || !mkws.locale_lang[lang]) {
+            mkws.config.lang = ""
+        } else {
+            mkws.config.lang = lang;
+        }
+
+        log("Locale language: " + (mkws.config.lang ? mkws.config.lang : "none"));
+
        if (mkws.config.query_width < 5 || mkws.config.query_width > 150) {
            log("Reset query width: " + mkws.config.query_width);
            mkws.config.query_width = 50;
index 4e91fce..3974fd9 100644 (file)
@@ -443,14 +443,5 @@ function team($, teamName) {
     }
 
 
-    var lang = mkws.getParameterByName("lang") || mkws.config.lang;
-    if (!lang || !mkws.locale_lang[lang]) {
-       mkws.config.lang = ""
-    } else {
-       mkws.config.lang = lang;
-    }
-
-    log("Locale language: " + (mkws.config.lang ? mkws.config.lang : "none"));
-
     return that;
 };