translate sort options, MKWS-366
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 28 Jan 2015 16:32:34 +0000 (16:32 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 28 Jan 2015 16:32:34 +0000 (16:32 +0000)
src/mkws-core.js
src/mkws-widget-main.js
test/spec/mkws-pazpar2.js

index 719e3e0..16f893a 100644 (file)
@@ -48,6 +48,10 @@ window.mkws = {
       "Location": "Ort",
       "Records": "Datens&auml;tze",
       "Targets": "Datenbanken",
+      "relevance": "Relevanz",
+      "title": "Titel",
+      "newest": "Neueste",
+      "oldest": "&Auml;lteste",
 
       "dummy": "dummy"
     },
@@ -77,6 +81,10 @@ window.mkws = {
       "Location": "Lokation",
       "Records": "Poster",
       "Targets": "Baser",
+      "relevance": "Relevans",
+      "title": "Titel",
+      "newest": "Nyeste",
+      "oldest": "Ældste",
 
       "dummy": "dummy"
     }
@@ -162,7 +170,7 @@ mkws.registerWidgetType = function(name, fn) {
 mkws.aliasWidgetType = function(newName, oldName) {
   mkws.widgetType2function[newName] = mkws.widgetType2function[oldName];
   mkws.info("aliased widget-type '" + newName + "' to '" + oldName + "'");
-  
+
 };
 
 mkws.promotionFunction = function(name) {
@@ -538,7 +546,7 @@ mkws.info("Using window.name '" + window.name + "'");
   // or a selector string you would like to constrain the search for widgets to.
   //
   // This function has no side effects if run again on an operating session,
-  // even if the element/selector passed causes existing widgets to be reparsed: 
+  // even if the element/selector passed causes existing widgets to be reparsed:
   //
   // (TODO: that last bit isn't true and we currently have to avoid reinitialising
   // widgets, MKWS-261)
@@ -549,7 +557,7 @@ mkws.info("Using window.name '" + window.name + "'");
   mkws.init = function(message, rootsel) {
     var greet = "MKWS initialised";
     if (rootsel) greet += " (limited to " + rootsel + ")"
-    if (message) greet += " :: " + message; 
+    if (message) greet += " :: " + message;
     mkws.info(greet);
 
     // MKWS is not active until init() has been run against an object with widget nodes.
@@ -662,7 +670,7 @@ mkws.info("Using window.name '" + window.name + "'");
         mkws.teams[teamName].queue("authenticated").publish();
       }
     }
-    
+
     mkws.isActive = true;
     return true;
   };
index a20e270..8fad7d9 100644 (file)
@@ -259,7 +259,7 @@ mkws.registerWidgetType('ranking', function() {
     var cur = {};
     var opt = this.config.sort_options[i];
     cur.key = opt[0];
-    cur.label = opt.length == 1 ? opt[0] : opt[1];
+    cur.label = opt.length == 1 ? opt[0] : mkws.M(opt[1]);
     if (order == cur.key || order == cur.label) cur.selected = true;
     output.sort.push(cur);
   }
index 487636d..833952c 100644 (file)
@@ -580,6 +580,10 @@ describe("Check translations", function () {
       "Location": "Ort",
       "Records": "Datens&auml;tze",
       "Targets": "Datenbanken",
+      "relevance": "Relevanz",
+      "title": "Titel",
+      "newest": "Neueste",
+      "oldest": "&Auml;lteste",
 
       "dummy": "dummy"
     },