From 8daa7d419a59a1901a351541f6c4847e6f1b0585 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 28 Jan 2015 16:32:34 +0000 Subject: [PATCH] translate sort options, MKWS-366 --- src/mkws-core.js | 16 ++++++++++++---- src/mkws-widget-main.js | 2 +- test/spec/mkws-pazpar2.js | 4 ++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/mkws-core.js b/src/mkws-core.js index 719e3e0..16f893a 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -48,6 +48,10 @@ window.mkws = { "Location": "Ort", "Records": "Datensätze", "Targets": "Datenbanken", + "relevance": "Relevanz", + "title": "Titel", + "newest": "Neueste", + "oldest": "Ä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; }; diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index a20e270..8fad7d9 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -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); } diff --git a/test/spec/mkws-pazpar2.js b/test/spec/mkws-pazpar2.js index 487636d..833952c 100644 --- a/test/spec/mkws-pazpar2.js +++ b/test/spec/mkws-pazpar2.js @@ -580,6 +580,10 @@ describe("Check translations", function () { "Location": "Ort", "Records": "Datensätze", "Targets": "Datenbanken", + "relevance": "Relevanz", + "title": "Titel", + "newest": "Neueste", + "oldest": "Älteste", "dummy": "dummy" }, -- 1.7.10.4