Skip to content

Commit

Permalink
Fix tags table and tests after i18n moves.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Sep 27, 2016
1 parent 6328eb3 commit 3c3201f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dwv.html.appendHCell = function (row, text)
{
var cell = document.createElement("th");
// TODO jquery-mobile specific...
if ( text !== "value" && text !== "name" ) {
if ( text !== dwv.i18n("basics.value") && text !== dwv.i18n("basics.name") ) {
cell.setAttribute("data-priority", "1");
}
cell.appendChild(document.createTextNode(text));
Expand Down
2 changes: 1 addition & 1 deletion tests/html/html.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ QUnit.test("Test array to html function.", function (assert) {
obj.first = {"a":0, "b":1};
obj.second = {"a":"hello", "b":undefined};
var table3 = dwv.html.toTable(obj);
var table3_ref = "<table><thead><tr><th>name</th><th data-priority=\"1\">a</th><th data-priority=\"1\">b</th></tr></thead><tbody><tr><td>first</td><td>0</td><td>1</td></tr><tr><td>second</td><td>hello</td><td>undefined</td></tr></tbody></table>";
var table3_ref = "<table><thead><tr><th data-priority=\"1\">name</th><th data-priority=\"1\">a</th><th data-priority=\"1\">b</th></tr></thead><tbody><tr><td>first</td><td>0</td><td>1</td></tr><tr><td>second</td><td>hello</td><td>undefined</td></tr></tbody></table>";
assert.equal(table3.outerHTML, table3_ref, "Object");
});
8 changes: 6 additions & 2 deletions tests/visual/appgui.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ dwv.gui.displayProgress = function (/*percent*/) {};
// check browser support
dwv.browser.check();

// fake translation function used in table creation.
dwv.i18n = function (text) {
return text.substring(text.lastIndexOf('.') + 1, text.length);
};

// test data line
dwv.addDataLine = function (id, fileroot, doc)
{
Expand All @@ -46,8 +51,7 @@ dwv.addDataLine = function (id, fileroot, doc)
// dwv application
var config = {
"containerDivId": id,
"skipLoadUrl": true,
"useWebWorkers": true
"skipLoadUrl": true
};
var url = "../data/" + fileroot + ".dcm";
var app = new dwv.App();
Expand Down

0 comments on commit 3c3201f

Please sign in to comment.