Internationalization of the facets part

This commit is contained in:
Blakko 2013-07-05 09:30:37 +02:00
parent 5a6bef4162
commit 19b91bd282
6 changed files with 109 additions and 65 deletions

View File

@ -148,23 +148,23 @@ ListFacet.prototype._initializeUI = function() {
this._div.empty().show().html( this._div.empty().show().html(
'<div class="facet-title">' + '<div class="facet-title">' +
'<div class="grid-layout layout-tightest layout-full"><table><tr>' + '<div class="grid-layout layout-tightest layout-full"><table><tr>' +
'<td width="1%"><a href="javascript:{}" title="Remove this facet" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' + '<td width="1%"><a href="javascript:{}" title="'+$.i18n._('core-facets')["remove-facet"]+'" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' +
'<td>' + '<td>' +
'<a href="javascript:{}" class="facet-choice-link" bind="resetButton">reset</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="resetButton">'+$.i18n._('core-facets')["reset"]+'</a>' +
'<a href="javascript:{}" class="facet-choice-link" bind="invertButton">invert</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="invertButton">'+$.i18n._('core-facets')["invert"]+'</a>' +
'<a href="javascript:{}" class="facet-choice-link" bind="changeButton">change</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="changeButton">'+$.i18n._('core-facets')["change"]+'</a>' +
'<span bind="titleSpan"></span>' + '<span bind="titleSpan"></span>' +
'</td>' + '</td>' +
'</tr></table></div>' + '</tr></table></div>' +
'</div>' + '</div>' +
'<div class="facet-expression" bind="expressionDiv" title="Click to edit expression"></div>' + '<div class="facet-expression" bind="expressionDiv" title="'+$.i18n._('core-facets')["click-to-edit"]+'"></div>' +
'<div class="facet-controls" bind="controlsDiv" style="display:none;">' + '<div class="facet-controls" bind="controlsDiv" style="display:none;">' +
'<a bind="choiceCountContainer" class="action" href="javascript:{}"></a> ' + '<a bind="choiceCountContainer" class="action" href="javascript:{}"></a> ' +
'<span class="facet-controls-sortControls" bind="sortGroup">Sort by: ' + '<span class="facet-controls-sortControls" bind="sortGroup">'+$.i18n._('core-facets')["sort-by"]+': ' +
'<a href="javascript:{}" bind="sortByNameLink">name</a>' + '<a href="javascript:{}" bind="sortByNameLink">'+$.i18n._('core-facets')["name"]+'</a>' +
'<a href="javascript:{}" bind="sortByCountLink">count</a>' + '<a href="javascript:{}" bind="sortByCountLink">'+$.i18n._('core-facets')["count"]+'</a>' +
'</span>' + '</span>' +
'<button bind="clusterLink" class="facet-controls-button button">Cluster</button>' + '<button bind="clusterLink" class="facet-controls-button button">'+$.i18n._('core-facets')["cluster"]+'</button>' +
'</div>' + '</div>' +
'<div class="facet-body" bind="bodyDiv">' + '<div class="facet-body" bind="bodyDiv">' +
'<div class="facet-body-inner" bind="bodyInnerDiv"></div>' + '<div class="facet-body-inner" bind="bodyInnerDiv"></div>' +
@ -173,7 +173,7 @@ ListFacet.prototype._initializeUI = function() {
this._elmts = DOM.bind(this._div); this._elmts = DOM.bind(this._div);
this._elmts.titleSpan.text(this._config.name); this._elmts.titleSpan.text(this._config.name);
this._elmts.changeButton.attr("title","Current Expression: " + this._config.expression).click(function() { this._elmts.changeButton.attr("title",$.i18n._('core-facets')["current-exp"]+": " + this._config.expression).click(function() {
self._elmts.expressionDiv.slideToggle(100, function() { self._elmts.expressionDiv.slideToggle(100, function() {
if (self._elmts.expressionDiv.css("display") != "none") { if (self._elmts.expressionDiv.css("display") != "none") {
self._editExpression(); self._editExpression();
@ -223,14 +223,14 @@ ListFacet.prototype._copyChoices = function() {
var frame = DialogSystem.createDialog(); var frame = DialogSystem.createDialog();
frame.width("600px"); frame.width("600px");
var header = $('<div></div>').addClass("dialog-header").text("Facet Choices as Tab Separated Values").appendTo(frame); var header = $('<div></div>').addClass("dialog-header").text($.i18n._('core-facets')["facet-choices"]).appendTo(frame);
var body = $('<div></div>').addClass("dialog-body").appendTo(frame); var body = $('<div></div>').addClass("dialog-body").appendTo(frame);
var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame); var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame);
body.html('<textarea wrap="off" bind="textarea" style="display: block; width: 100%; height: 400px;" />'); body.html('<textarea wrap="off" bind="textarea" style="display: block; width: 100%; height: 400px;" />');
var elmts = DOM.bind(body); var elmts = DOM.bind(body);
$('<button class="button"></button>').text("Close").click(function() { $('<button class="button"></button>').text($.i18n._('core-button')["close"]).click(function() {
DialogSystem.dismissUntil(level - 1); DialogSystem.dismissUntil(level - 1);
}).appendTo(footer); }).appendTo(footer);
@ -270,7 +270,7 @@ ListFacet.prototype._update = function(resetScroll) {
//this._elmts.statusDiv.hide(); //this._elmts.statusDiv.hide();
this._elmts.controlsDiv.hide(); this._elmts.controlsDiv.hide();
this._elmts.bodyInnerDiv.empty().append( this._elmts.bodyInnerDiv.empty().append(
$('<div>').text("Loading...").addClass("facet-body-message")); $('<div>').text($.i18n._('core-facets')["loading"]).addClass("facet-body-message"));
return; return;
} else if ("error" in this._data) { } else if ("error" in this._data) {
@ -281,12 +281,12 @@ ListFacet.prototype._update = function(resetScroll) {
this._elmts.bodyInnerDiv.empty(); this._elmts.bodyInnerDiv.empty();
var messageDiv = $('<div>') var messageDiv = $('<div>')
.text(this._data.choiceCount + " choices total, too many to display") .text(this._data.choiceCount + " "+$.i18n._('core-facets')["too-many-choices"])
.addClass("facet-body-message") .addClass("facet-body-message")
.appendTo(this._elmts.bodyInnerDiv); .appendTo(this._elmts.bodyInnerDiv);
$('<br>').appendTo(messageDiv); $('<br>').appendTo(messageDiv);
$('<a>') $('<a>')
.text("Set choice count limit") .text($.i18n._('core-facets')["set-choice-count"])
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.addClass("action") .addClass("action")
.addClass("secondary") .addClass("secondary")
@ -362,7 +362,7 @@ ListFacet.prototype._update = function(resetScroll) {
// edit link // edit link
if (renderEdit) { if (renderEdit) {
html.push('<a href="javascript:{}" class="facet-choice-link facet-choice-edit" style="visibility: hidden">edit</a>'); html.push('<a href="javascript:{}" class="facet-choice-link facet-choice-edit" style="visibility: hidden">'+$.i18n._('core-facets')["edit"]+'</a>');
} }
html.push('<a href="javascript:{}" class="facet-choice-label">' + encodeHtml(label) + '</a>'); html.push('<a href="javascript:{}" class="facet-choice-label">' + encodeHtml(label) + '</a>');
@ -463,7 +463,7 @@ ListFacet.prototype._renderBodyControls = function() {
.appendTo(this._elmts.bodyInnerDiv); .appendTo(this._elmts.bodyInnerDiv);
$('<a>') $('<a>')
.text("Facet by choice counts") .text($.i18n._('core-facets')["facet-by-count"])
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.addClass("action") .addClass("action")
.addClass("secondary") .addClass("secondary")
@ -505,12 +505,12 @@ ListFacet.prototype._editChoice = function(choice, choiceDiv) {
'<textarea class="data-table-cell-editor-editor" bind="textarea" />' + '<textarea class="data-table-cell-editor-editor" bind="textarea" />' +
'<div id="data-table-cell-editor-actions">' + '<div id="data-table-cell-editor-actions">' +
'<div class="data-table-cell-editor-action">' + '<div class="data-table-cell-editor-action">' +
'<button class="button" bind="okButton">Apply</button>' + '<button class="button" bind="okButton">'+$.i18n._('core-buttons')["apply"]+'</button>' +
'<div class="data-table-cell-editor-key">Enter</div>' + '<div class="data-table-cell-editor-key">'+$.i18n._('core-buttons')["enter"]+'</div>' +
'</div>' + '</div>' +
'<div class="data-table-cell-editor-action">' + '<div class="data-table-cell-editor-action">' +
'<button class="button" bind="cancelButton">Cancel</button>' + '<button class="button" bind="cancelButton">'+$.i18n._('core-buttons')["cancel"]+'</button>' +
'<div class="data-table-cell-editor-key">Esc</div>' + '<div class="data-table-cell-editor-key">'+$.i18n._('core-buttons')["esc"]+'</div>' +
'</div>' + '</div>' +
'</div>' '</div>'
); );
@ -663,8 +663,8 @@ ListFacet.prototype._updateRest = function() {
ListFacet.prototype._editExpression = function() { ListFacet.prototype._editExpression = function() {
var self = this; var self = this;
var title = (this._config.columnName) ? var title = (this._config.columnName) ?
("Edit Facet's Expression based on Column " + this._config.columnName) : ($.i18n._('core-facets')["edit-based-col"]+" " + this._config.columnName) :
"Edit Facet's Expression"; $.i18n._('core-facets')["edit-facet-exp"];
var column = Refine.columnNameToColumn(this._config.columnName); var column = Refine.columnNameToColumn(this._config.columnName);
var o = DataTableView.sampleVisibleRows(column); var o = DataTableView.sampleVisibleRows(column);
@ -680,7 +680,7 @@ ListFacet.prototype._editExpression = function() {
self._config.expression = expr; self._config.expression = expr;
self._elmts.expressionDiv.text(self._config.expression); self._elmts.expressionDiv.text(self._config.expression);
self._elmts.changeButton.attr("title", "Current Expression: " + self._config.expression); self._elmts.changeButton.attr("title", $.i18n._('core-facets')["current-exp"]+": " + self._config.expression);
if (self._config.expression == "value" || self._config.expression == "grel:value") { if (self._config.expression == "value" || self._config.expression == "grel:value") {
self._elmts.clusterLink.show(); self._elmts.clusterLink.show();
} else { } else {
@ -697,7 +697,7 @@ ListFacet.prototype._editExpression = function() {
ListFacet.prototype._setChoiceCountLimit = function(choiceCount) { ListFacet.prototype._setChoiceCountLimit = function(choiceCount) {
var limit = Math.ceil(choiceCount / 1000) * 1000; var limit = Math.ceil(choiceCount / 1000) * 1000;
var s = window.prompt('Set the maximum number of choices shown in each text facet (too many will slow down the application)', limit); var s = window.prompt($.i18n._('core-facets')["set-max-choices"], limit);
if (s) { if (s) {
var n = parseInt(s,10); var n = parseInt(s,10);

View File

@ -132,17 +132,17 @@ RangeFacet.prototype._initializeUI = function() {
.html( .html(
'<div class="facet-title" bind="headerDiv">' + '<div class="facet-title" bind="headerDiv">' +
'<div class="grid-layout layout-tightest layout-full"><table><tr>' + '<div class="grid-layout layout-tightest layout-full"><table><tr>' +
'<td width="1%"><a href="javascript:{}" title="Remove this facet" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' + '<td width="1%"><a href="javascript:{}" title="'+$.i18n._('core-facets')["remove-facet"]+'" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' +
'<td>' + '<td>' +
'<a href="javascript:{}" class="facet-choice-link" bind="resetButton">reset</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="resetButton">'+$.i18n._('core-facets')["reset"]+'</a>' +
'<a href="javascript:{}" class="facet-choice-link" bind="changeButton">change</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="changeButton">'+$.i18n._('core-facets')["change"]+'</a>' +
'<span bind="facetTitle"></span>' + '<span bind="facetTitle"></span>' +
'</td>' + '</td>' +
'</tr></table></div>' + '</tr></table></div>' +
'</div>' + '</div>' +
'<div class="facet-expression" bind="expressionDiv" title="Click to edit expression"></div>' + '<div class="facet-expression" bind="expressionDiv" title="'+$.i18n._('core-facets')["click-to-edit"]+'"></div>' +
'<div class="facet-range-body">' + '<div class="facet-range-body">' +
'<div class="facet-range-message" bind="messageDiv">Loading...</div>' + '<div class="facet-range-message" bind="messageDiv">'+$.i18n._('core-facets')["loading"]+'</div>' +
'<div class="facet-range-slider" bind="sliderWidgetDiv">' + '<div class="facet-range-slider" bind="sliderWidgetDiv">' +
'<div class="facet-range-histogram" bind="histogramDiv"></div>' + '<div class="facet-range-histogram" bind="histogramDiv"></div>' +
'</div>' + '</div>' +
@ -153,7 +153,7 @@ RangeFacet.prototype._initializeUI = function() {
this._elmts = DOM.bind(this._div); this._elmts = DOM.bind(this._div);
this._elmts.facetTitle.text(this._config.name); this._elmts.facetTitle.text(this._config.name);
this._elmts.changeButton.attr("title","Current Expression: " + this._config.expression).click(function() { this._elmts.changeButton.attr("title",$.i18n._('core-facets')["current-expression"]+": " + this._config.expression).click(function() {
self._elmts.expressionDiv.slideToggle(100, function() { self._elmts.expressionDiv.slideToggle(100, function() {
if (self._elmts.expressionDiv.css("display") != "none") { if (self._elmts.expressionDiv.css("display") != "none") {
self._editExpression(); self._editExpression();
@ -209,7 +209,7 @@ RangeFacet.prototype._renderOtherChoices = function() {
if (this._selectNumeric) numericCheck.attr("checked","checked"); if (this._selectNumeric) numericCheck.attr("checked","checked");
var numericLabel = $('<label>').attr("for", facet_id + "-numeric").appendTo(numericDiv); var numericLabel = $('<label>').attr("for", facet_id + "-numeric").appendTo(numericDiv);
$('<span>').text("Numeric ").addClass("facet-range-choice-label").appendTo(numericLabel); $('<span>').text($.i18n._('core-facets')["numeric"]+" ").addClass("facet-range-choice-label").appendTo(numericLabel);
$('<div>').text(this._numericCount).addClass("facet-range-choice-count").appendTo(numericLabel); $('<div>').text(this._numericCount).addClass("facet-range-choice-count").appendTo(numericLabel);
// ----------------- non-numeric ----------------- // ----------------- non-numeric -----------------
@ -315,7 +315,7 @@ RangeFacet.prototype.updateState = function(data) {
this._errorCount = data.errorCount; this._errorCount = data.errorCount;
} else { } else {
this._error = true; this._error = true;
this._errorMessage = "error" in data ? data.error : "Unknown error."; this._errorMessage = "error" in data ? data.error : $.i18n._('core-facets')["unknown-error"]+".";
} }
this.render(); this.render();
@ -375,8 +375,8 @@ RangeFacet.prototype._updateRest = function() {
RangeFacet.prototype._editExpression = function() { RangeFacet.prototype._editExpression = function() {
var self = this; var self = this;
var title = (this._config.columnName) ? var title = (this._config.columnName) ?
("Edit Facet's Expression based on Column " + this._config.columnName) : ($.i18n._('core-facets')["edit-based-col"]+" " + this._config.columnName) :
"Edit Facet's Expression"; $.i18n._('core-facets')["edit-facet-exp"];
var column = Refine.columnNameToColumn(this._config.columnName); var column = Refine.columnNameToColumn(this._config.columnName);
var o = DataTableView.sampleVisibleRows(column); var o = DataTableView.sampleVisibleRows(column);

View File

@ -93,15 +93,15 @@ ScatterplotFacet.prototype._initializeUI = function() {
this._div.empty().show().html( this._div.empty().show().html(
'<div class="facet-title">' + '<div class="facet-title">' +
'<div class="grid-layout layout-tightest layout-full"><table><tr>' + '<div class="grid-layout layout-tightest layout-full"><table><tr>' +
'<td width="1%"><a href="javascript:{}" title="Remove this facet" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' + '<td width="1%"><a href="javascript:{}" title="'+$.i18n._('core-facets')["remove-facet"]+'" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' +
'<td>' + '<td>' +
'<a href="javascript:{}" class="facet-choice-link" bind="resetButton">reset</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="resetButton">'+$.i18n._('core-facets')["reset"]+'</a>' +
'<span bind="titleSpan"></span>' + '<span bind="titleSpan"></span>' +
'</td>' + '</td>' +
'</tr></table></div>' + '</tr></table></div>' +
'</div>' + '</div>' +
'<div class="facet-scatterplot-body" bind="bodyDiv">' + '<div class="facet-scatterplot-body" bind="bodyDiv">' +
'<div class="facet-scatterplot-message" bind="messageDiv">Loading...</div>' + '<div class="facet-scatterplot-message" bind="messageDiv">'+$.i18n._('core-facets')["loading"]+'</div>' +
'<table width="100%"><tr>' + '<table width="100%"><tr>' +
'<td>' + '<td>' +
'<div class="facet-scatterplot-plot-container">' + '<div class="facet-scatterplot-plot-container">' +
@ -114,20 +114,20 @@ ScatterplotFacet.prototype._initializeUI = function() {
'<td class="facet-scatterplot-selectors-container" width="100%">' + '<td class="facet-scatterplot-selectors-container" width="100%">' +
'<div class="scatterplot-selectors" bind="selectors">' + '<div class="scatterplot-selectors" bind="selectors">' +
'<div class="buttonset scatterplot-dim-selector">' + '<div class="buttonset scatterplot-dim-selector">' +
'<input type="radio" id="' + facet_id + '-dim-lin" name="' + facet_id + '-dim" value="lin"/><label class="dim-lin-label" for="' + facet_id + '-dim-lin" title="Linear Plot">lin</label>' + '<input type="radio" id="' + facet_id + '-dim-lin" name="' + facet_id + '-dim" value="lin"/><label class="dim-lin-label" for="' + facet_id + '-dim-lin" title="'+$.i18n._('core-facets')["linear-plot"]+'">'+$.i18n._('core-facets')["linear-plot-abbr"]+'</label>' +
'<input type="radio" id="' + facet_id + '-dim-log" name="' + facet_id + '-dim" value="log"/><label class="dim-log-label" for="' + facet_id + '-dim-log" title="Logarithmic Plot">log</label>' + '<input type="radio" id="' + facet_id + '-dim-log" name="' + facet_id + '-dim" value="log"/><label class="dim-log-label" for="' + facet_id + '-dim-log" title="'+$.i18n._('core-facets')["logar-plot"]+'">'+$.i18n._('core-facets')["logar-plot-abbr"]+'</label>' +
'</div>' + '</div>' +
'<div class="buttonset scatterplot-rot-selector">' + '<div class="buttonset scatterplot-rot-selector">' +
'<input type="radio" id="' + facet_id + '-rot-ccw" name="' + facet_id + '-rot" value="ccw"/><label class="rot-ccw-label" for="' + facet_id + '-rot-ccw" title="Rotated 45° Counter-Clockwise">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-rot-ccw" name="' + facet_id + '-rot" value="ccw"/><label class="rot-ccw-label" for="' + facet_id + '-rot-ccw" title="'+$.i18n._('core-facets')["rotated-counter-clock"]+'">&nbsp;</label>' +
'<input type="radio" id="' + facet_id + '-rot-none" name="' + facet_id + '-rot" value="none"/><label class="rot-none-label" for="' + facet_id + '-rot-none" title="No rotation">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-rot-none" name="' + facet_id + '-rot" value="none"/><label class="rot-none-label" for="' + facet_id + '-rot-none" title="'+$.i18n._('core-facets')["no-rotation"]+'">&nbsp;</label>' +
'<input type="radio" id="' + facet_id + '-rot-cw" name="' + facet_id + '-rot" value="cw"/><label class="rot-cw-label" for="' + facet_id + '-rot-cw" title="Rotated 45° Clockwise">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-rot-cw" name="' + facet_id + '-rot" value="cw"/><label class="rot-cw-label" for="' + facet_id + '-rot-cw" title="'+$.i18n._('core-facets')["rotated-clock"]+'">&nbsp;</label>' +
'</div>' + '</div>' +
'<div class="buttonset scatterplot-dot-selector">' + '<div class="buttonset scatterplot-dot-selector">' +
'<input type="radio" id="' + facet_id + '-dot-small" name="' + facet_id + '-dot" value="small"/><label class="dot-small-label" for="' + facet_id + '-dot-small" title="Small Dot Size">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-dot-small" name="' + facet_id + '-dot" value="small"/><label class="dot-small-label" for="' + facet_id + '-dot-small" title="'+$.i18n._('core-facets')["small-dot"]+'">&nbsp;</label>' +
'<input type="radio" id="' + facet_id + '-dot-regular" name="' + facet_id + '-dot" value="regular"/><label class="dot-regular-label" for="' + facet_id + '-dot-regular" title="Regular Dot Size">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-dot-regular" name="' + facet_id + '-dot" value="regular"/><label class="dot-regular-label" for="' + facet_id + '-dot-regular" title="'+$.i18n._('core-facets')["regular-dot"]+'">&nbsp;</label>' +
'<input type="radio" id="' + facet_id + '-dot-big" name="' + facet_id + '-dot" value="big"/><label class="dot-big-label" for="' + facet_id + '-dot-big" title="Big Dot Size">&nbsp;</label>' + '<input type="radio" id="' + facet_id + '-dot-big" name="' + facet_id + '-dot" value="big"/><label class="dot-big-label" for="' + facet_id + '-dot-big" title="'+$.i18n._('core-facets')["big-dot"]+'">&nbsp;</label>' +
'</div>' + '</div>' +
'<div class="scatterplot-export-plot"><a bind="exportPlotLink" class="action" target="_blank">export plot</a></div>' + '<div class="scatterplot-export-plot"><a bind="exportPlotLink" class="action" target="_blank">'+$.i18n._('core-facets')["export-plot"]+'</a></div>' +
'</div>' + '</div>' +
'</td>' + '</td>' +
'</tr></table>' + '</tr></table>' +
@ -279,7 +279,7 @@ ScatterplotFacet.prototype._formulateImageUrl = function(engineConfig, conf) {
ScatterplotFacet.prototype.updateState = function(data) { ScatterplotFacet.prototype.updateState = function(data) {
if ("error" in data) { if ("error" in data) {
this._error = true; this._error = true;
this._errorMessage = "error" in data ? data.error : "Unknown error."; this._errorMessage = "error" in data ? data.error : $.i18n._('core-facets')["unknown-error"]+".";
} else { } else {
this._error = false; this._error = false;

View File

@ -84,7 +84,7 @@ TextSearchFacet.prototype._initializeUI = function() {
this._div.empty().show().html( this._div.empty().show().html(
'<div class="facet-title">' + '<div class="facet-title">' +
'<div class="grid-layout layout-tightest layout-full"><table><tr>' + '<div class="grid-layout layout-tightest layout-full"><table><tr>' +
'<td width="1%"><a href="javascript:{}" title="Remove this facet" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' + '<td width="1%"><a href="javascript:{}" title="'+$.i18n._('core-facets')["remove-facet"]+'" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' +
'<td>' + '<td>' +
'<span>' + this._config.name + '</span>' + '<span>' + this._config.name + '</span>' +
'</td>' + '</td>' +
@ -93,8 +93,8 @@ TextSearchFacet.prototype._initializeUI = function() {
'<div class="facet-text-body"><div class="grid-layout layout-tightest layout-full"><table>' + '<div class="facet-text-body"><div class="grid-layout layout-tightest layout-full"><table>' +
'<tr><td colspan="4"><div class="input-container"><input bind="input" /></div></td></tr>' + '<tr><td colspan="4"><div class="input-container"><input bind="input" /></div></td></tr>' +
'<tr>' + '<tr>' +
'<td width="1%"><input type="checkbox" bind="caseSensitiveCheckbox" /></td><td>case sensitive</td>' + '<td width="1%"><input type="checkbox" bind="caseSensitiveCheckbox" /></td><td>'+$.i18n._('core-facets')["case-sensitive"]+'</td>' +
'<td width="1%"><input type="checkbox" bind="regexCheckbox" /></td><td>regular expression</td>' + '<td width="1%"><input type="checkbox" bind="regexCheckbox" /></td><td>'+$.i18n._('core-facets')["regular-exp"]+'</td>' +
'</tr>' + '</tr>' +
'</table></div></div>' '</table></div></div>'
); );

View File

@ -133,17 +133,17 @@ TimeRangeFacet.prototype._initializeUI = function() {
.html( .html(
'<div class="facet-title" bind="headerDiv">' + '<div class="facet-title" bind="headerDiv">' +
'<div class="grid-layout layout-tightest layout-full"><table><tr>' + '<div class="grid-layout layout-tightest layout-full"><table><tr>' +
'<td width="1%"><a href="javascript:{}" title="Remove this facet" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' + '<td width="1%"><a href="javascript:{}" title="'+$.i18n._('core-facets')["remove-facet"]+'" class="facet-title-remove" bind="removeButton">&nbsp;</a></td>' +
'<td>' + '<td>' +
'<a href="javascript:{}" class="facet-choice-link" bind="resetButton">reset</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="resetButton">'+$.i18n._('core-facets')["reset"]+'</a>' +
'<a href="javascript:{}" class="facet-choice-link" bind="changeButton">change</a>' + '<a href="javascript:{}" class="facet-choice-link" bind="changeButton">'+$.i18n._('core-facets')["change"]+'</a>' +
'<span bind="facetTitle"></span>' + '<span bind="facetTitle"></span>' +
'</td>' + '</td>' +
'</tr></table></div>' + '</tr></table></div>' +
'</div>' + '</div>' +
'<div class="facet-expression" bind="expressionDiv" title="Click to edit expression"></div>' + '<div class="facet-expression" bind="expressionDiv" title="'+$.i18n._('core-facets')["click-to-edit"]+'"></div>' +
'<div class="facet-range-body">' + '<div class="facet-range-body">' +
'<div class="facet-range-message" bind="messageDiv">Loading...</div>' + '<div class="facet-range-message" bind="messageDiv">'+$.i18n._('core-facets')["loading"]+'</div>' +
'<div class="facet-range-slider" bind="sliderWidgetDiv">' + '<div class="facet-range-slider" bind="sliderWidgetDiv">' +
'<div class="facet-range-histogram" bind="histogramDiv"></div>' + '<div class="facet-range-histogram" bind="histogramDiv"></div>' +
'</div>' + '</div>' +
@ -154,7 +154,7 @@ TimeRangeFacet.prototype._initializeUI = function() {
this._elmts = DOM.bind(this._div); this._elmts = DOM.bind(this._div);
this._elmts.facetTitle.text(this._config.name); this._elmts.facetTitle.text(this._config.name);
this._elmts.changeButton.attr("title","Current Expression: " + this._config.expression).click(function() { this._elmts.changeButton.attr("title",$.i18n._('core-facets')["current-exp"]+": " + this._config.expression).click(function() {
self._elmts.expressionDiv.slideToggle(100, function() { self._elmts.expressionDiv.slideToggle(100, function() {
if (self._elmts.expressionDiv.css("display") != "none") { if (self._elmts.expressionDiv.css("display") != "none") {
self._editExpression(); self._editExpression();
@ -210,7 +210,7 @@ TimeRangeFacet.prototype._renderOtherChoices = function() {
if (this._selectTime) timeCheck.attr("checked","checked"); if (this._selectTime) timeCheck.attr("checked","checked");
var timeLabel = $('<label>').attr("for", facet_id + "-time").appendTo(timeDiv); var timeLabel = $('<label>').attr("for", facet_id + "-time").appendTo(timeDiv);
$('<span>').text("Time ").addClass("facet-range-choice-label").appendTo(timeLabel); $('<span>').text($.i18n._('core-facets')["time"]+" ").addClass("facet-range-choice-label").appendTo(timeLabel);
$('<div>').text(this._timeCount).addClass("facet-range-choice-count").appendTo(timeLabel); $('<div>').text(this._timeCount).addClass("facet-range-choice-count").appendTo(timeLabel);
// ----------------- non-Time ----------------- // ----------------- non-Time -----------------
@ -223,7 +223,7 @@ TimeRangeFacet.prototype._renderOtherChoices = function() {
if (this._selectNonTime) nonTimeCheck.attr("checked","checked"); if (this._selectNonTime) nonTimeCheck.attr("checked","checked");
var nonTimeLabel = $('<label>').attr("for", facet_id + "-non-time").appendTo(nonTimeDiv); var nonTimeLabel = $('<label>').attr("for", facet_id + "-non-time").appendTo(nonTimeDiv);
$('<span>').text("Non-Time ").addClass("facet-range-choice-label").appendTo(nonTimeLabel); $('<span>').text($.i18n._('core-facets')["non-time"]+" ").addClass("facet-range-choice-label").appendTo(nonTimeLabel);
$('<div>').text(this._nonTimeCount).addClass("facet-range-choice-count").appendTo(nonTimeLabel); $('<div>').text(this._nonTimeCount).addClass("facet-range-choice-count").appendTo(nonTimeLabel);
if (this._baseNonTimeCount === 0) nonTimeCheck.removeAttr("checked"); if (this._baseNonTimeCount === 0) nonTimeCheck.removeAttr("checked");
@ -238,7 +238,7 @@ TimeRangeFacet.prototype._renderOtherChoices = function() {
if (this._selectBlank) blankCheck.attr("checked","checked"); if (this._selectBlank) blankCheck.attr("checked","checked");
var blankLabel = $('<label>').attr("for", facet_id + "-blank").appendTo(blankDiv); var blankLabel = $('<label>').attr("for", facet_id + "-blank").appendTo(blankDiv);
$('<span>').text("Blank ").addClass("facet-range-choice-label").appendTo(blankLabel); $('<span>').text($.i18n._('core-facets')["blank"]+" ").addClass("facet-range-choice-label").appendTo(blankLabel);
$('<div>').text(this._blankCount).addClass("facet-range-choice-count").appendTo(blankLabel); $('<div>').text(this._blankCount).addClass("facet-range-choice-count").appendTo(blankLabel);
if (this._baseBlankCount === 0) blankCheck.removeAttr("checked"); if (this._baseBlankCount === 0) blankCheck.removeAttr("checked");
@ -253,7 +253,7 @@ TimeRangeFacet.prototype._renderOtherChoices = function() {
if (this._selectError) errorCheck.attr("checked","checked"); if (this._selectError) errorCheck.attr("checked","checked");
var errorLabel = $('<label>').attr("for", facet_id + "-error").appendTo(errorDiv); var errorLabel = $('<label>').attr("for", facet_id + "-error").appendTo(errorDiv);
$('<span>').text("Error ").addClass("facet-range-choice-label").appendTo(errorLabel); $('<span>').text($.i18n._('core-facets')["error"]+" ").addClass("facet-range-choice-label").appendTo(errorLabel);
$('<div>').text(this._errorCount).addClass("facet-range-choice-count").appendTo(errorLabel); $('<div>').text(this._errorCount).addClass("facet-range-choice-count").appendTo(errorLabel);
if (this._baseErrorCount === 0) errorCheck.removeAttr("checked"); if (this._baseErrorCount === 0) errorCheck.removeAttr("checked");
@ -342,7 +342,7 @@ TimeRangeFacet.prototype.updateState = function(data) {
this._errorCount = data.errorCount; this._errorCount = data.errorCount;
} else { } else {
this._error = true; this._error = true;
this._errorMessage = "error" in data ? data.error : "Unknown error."; this._errorMessage = "error" in data ? data.error : $.i18n._('core-facets')["unknown-error"]+".";
} }
this.render(); this.render();
@ -402,8 +402,8 @@ TimeRangeFacet.prototype._updateRest = function() {
TimeRangeFacet.prototype._editExpression = function() { TimeRangeFacet.prototype._editExpression = function() {
var self = this; var self = this;
var title = (this._config.columnName) ? var title = (this._config.columnName) ?
("Edit Facet's Expression based on Column " + this._config.columnName) : ($.i18n._('core-facets')["edit-based-col"]+" " + this._config.columnName) :
"Edit Facet's Expression"; $.i18n._('core-facets')["edit-facet-exp"];
var column = Refine.columnNameToColumn(this._config.columnName); var column = Refine.columnNameToColumn(this._config.columnName);
var o = DataTableView.sampleVisibleRows(column); var o = DataTableView.sampleVisibleRows(column);

View File

@ -238,6 +238,48 @@
"upload-to": "Upload to", "upload-to": "Upload to",
"json-text": "The following JSON text encodes the options you have set in the other tabs. You can copy it out and save it for later, and paste it back in and click Apply to re-use the same options." "json-text": "The following JSON text encodes the options you have set in the other tabs. You can copy it out and save it for later, and paste it back in and click Apply to re-use the same options."
}, },
"core-facets": {
"remove-facet": "Remove this facet",
"reset": "reset",
"invert": "invert",
"change": "change",
"click-to-edit": "Click to edit expression",
"sort-by": "Sort by",
"name": "name",
"count": "count",
"cluster": "Cluster",
"current-exp": "Current Expression",
"facet-choices": "Facet Choices as Tab Separated Values",
"loading": "Loading...",
"too-many-choices": "choices total, too many to display",
"set-choice-count": "Set choice count limit",
"edit": "edit",
"facet-by-count": "Facet by choice counts",
"edit-based-col": "Edit Facet's Expression based on Column",
"edit-facet-exp": "Edit Facet's Expression",
"current-exp": "Current Expression",
"set-max-choices": "Set the maximum number of choices shown in each text facet (too many will slow down the application)",
"case-sensitive": "case sensitive",
"regular-exp": "regular expression",
"time": "Time",
"non-time": "Non-Time",
"blank": "Blank",
"error": "Error",
"unknown-error": "Unknown error",
"linear-plot": "Linear Plot",
"linear-plot-abbr": "lin",
"logar-plot": "Logarithmic Plot",
"logar-plot-abbr": "log",
"rotated-counter-clock": "Rotated 45° Counter-Clockwise",
"no-rotation": "No rotation",
"rotated-clock": "Rotated 45° Clockwise",
"small-dot": "Small Dot Size",
"regular-dot": "Regular Dot Size",
"big-dot": "Big Dot Size",
"export-plot": "export plot",
"numeric": "Numeric"
},
"core-buttons": { "core-buttons": {
"cancel": "Cancel", "cancel": "Cancel",
"ok": "&nbsp;&nbsp;OK&nbsp;&nbsp;", "ok": "&nbsp;&nbsp;OK&nbsp;&nbsp;",
@ -263,6 +305,8 @@
"preview": "Preview", "preview": "Preview",
"download": "Download", "download": "Download",
"upload": "Upload", "upload": "Upload",
"apply": "Apply" "apply": "Apply",
"enter": "Enter",
"esc": "Esc"
} }
} }