});
// temporary disabled due records without an author, MKWS-400
-xdescribe("Check translations", function () {
+describe("Check translations", function () {
var $ = mkws.$;
// handle html entities, "Zurück" => "Zurück"
debug("translate check for: " + text);
return text;
};
+
var lang = function () {
return mkws.config.lang
};
}
}
+ function check_translation_list(list, keywords) {
+ var errors = [];
+ for (var i = 0; i < keywords.length; i++) {
+ var text = $(list[i]);
+ var keyword = keywords[i];
+
+ if (text.text().match("^" + M(keyword) + "")) {
+ debug("found: " + text.text() + " :: " + keyword);
+ } else {
+ debug("NOT found: " + text.text() + " :: " + keyword);
+ errors.push(keyword)
+ }
+ }
+
+ // we except one missing field, or one error
+ expect(errors.length).not.toBeGreaterThan(1);
+ }
+
it("check language", function () {
var lang = mkws.config.lang;
debug("lang: " + lang);
});
it("record details", function () {
- var text = ["Title", "Date", "Author"]; // , "Subject", "Locations"];
+ var keywords = ["Title", "Date", "Author"]; // , "Subject", "Locations"];
var list = $("div.mkws-details table > tbody > tr > th");
// compare only the first 3 elements
- list = list.splice(0, text.length)
-
- check_translation(list, text);
+ // list = list.splice(0, text.length)
+ check_translation_list(list, keywords);
});
/* not tested