From 5a6bef416274e9b044fd9c6e449b1c502469f79e Mon Sep 17 00:00:00 2001 From: Blakko Date: Thu, 4 Jul 2013 11:51:04 +0200 Subject: [PATCH] Internationalization of the dialog part --- .../scripts/dialogs/clustering-dialog.html | 48 +++---- .../core/scripts/dialogs/clustering-dialog.js | 62 +++++--- .../dialogs/column-reordering-dialog.html | 10 +- .../dialogs/column-reordering-dialog.js | 7 + .../custom-tabular-exporter-dialog.html | 95 ++++++------- .../dialogs/custom-tabular-exporter-dialog.js | 49 ++++++- .../dialogs/expression-preview-dialog.html | 12 +- .../dialogs/expression-preview-dialog.js | 39 +++--- .../scripts/dialogs/scatterplot-dialog.html | 18 +-- .../scripts/dialogs/scatterplot-dialog.js | 19 ++- .../dialogs/templating-exporter-dialog.html | 16 +-- .../dialogs/templating-exporter-dialog.js | 13 +- main/webapp/modules/core/scripts/project.js | 18 +++ main/webapp/modules/langs/translation-en.json | 132 +++++++++++++++++- 14 files changed, 388 insertions(+), 150 deletions(-) diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html index 151201ce8..3e23fbf43 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html @@ -4,40 +4,38 @@
- This feature helps you find groups of different cell values that might be - alternative representations of the same thing. For example, the two strings - "New York" and "new york" are very likely to refer to the same concept and - just have capitalization differences, and "Gödel" and "Godel" probably refer - to the same person. - Find out more ... + +
- Method  + + -
Keying Function  + + + +
-
@@ -54,13 +52,13 @@ diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js index 7d22949d6..2c26a85ac 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js @@ -49,23 +49,45 @@ ClusteringDialog.prototype._createDialog = function() { var dialog = $(DOM.loadHTML("core", "scripts/dialogs/clustering-dialog.html")); this._elmts = DOM.bind(dialog); - this._elmts.dialogHeader.text('Cluster & Edit column "' + this._columnName + '"'); - + this._elmts.dialogHeader.text($.i18n._('core-dialogs')["cluster-edit"]+' "' + this._columnName + '"'); + + this._elmts.or_dialog_descr.html($.i18n._('core-dialogs')["cluster-descr"]); + this._elmts.or_dialog_findMore.html($.i18n._('core-dialogs')["find-more"]); + this._elmts.or_dialog_method.html($.i18n._('core-dialogs')["method"]); + this._elmts.or_dialog_keyCollision.html($.i18n._('core-dialogs')["key-collision"]); + this._elmts.or_dialog_neighbor.html($.i18n._('core-dialogs')["nearest-neighbor"]); + this._elmts.or_dialog_keying.html($.i18n._('core-dialogs')["keying-function"]); + this._elmts.or_dialog_fingerprint.html($.i18n._('core-dialogs')["fingerprint"]); + this._elmts.or_dialog_ngram.html($.i18n._('core-dialogs')["ngram"]); + this._elmts.or_dialog_metaphone.html($.i18n._('core-dialogs')["metaphone"]); + this._elmts.or_dialog_phonetic.html($.i18n._('core-dialogs')["phonetic"]); + this._elmts.or_dialog_distance.html($.i18n._('core-dialogs')["distance-fun"]); + this._elmts.or_dialog_leven.html($.i18n._('core-dialogs')["leven"]); + this._elmts.or_dialog_ppm.html($.i18n._('core-dialogs')["ppm"]); + this._elmts.or_dialog_ngramSize.html($.i18n._('core-dialogs')["ngram-size"]); + this._elmts.or_dialog_radius.html($.i18n._('core-dialogs')["ngram-radius"]); + this._elmts.or_dialog_blockChars.html($.i18n._('core-dialogs')["block-chars"]); + this._elmts.selectAllButton.html($.i18n._('core-buttons')["select-all"]); + this._elmts.deselectAllButton.html($.i18n._('core-buttons')["unselect-all"]); + this._elmts.applyReClusterButton.html($.i18n._('core-buttons')["merge-cluster"]); + this._elmts.applyCloseButton.html($.i18n._('core-buttons')["merge-close"]); + this._elmts.closeButton.html($.i18n._('core-buttons')["close"]); + this._elmts.methodSelector.change(function() { var selection = $(this).find("option:selected").text(); - if (selection == 'key collision') { + if (selection == $.i18n._('core-dialogs')["key-collision"]) { dialog.find(".binning-controls").show(); dialog.find(".knn-controls").hide(); self._method = "binning"; self._elmts.keyingFunctionSelector.change(); - } else if (selection === 'nearest neighbor') { + } else if (selection === $.i18n._('core-dialogs')["nearest-neighbor"]) { dialog.find(".binning-controls").hide(); dialog.find(".knn-controls").show(); self._method = "knn"; self._elmts.distanceFunctionSelector.change(); } }); - + var changer = function() { self._function = $(this).find("option:selected").text(); $(".function-params").hide(); @@ -116,11 +138,11 @@ ClusteringDialog.prototype._renderTable = function(clusters) { var trHead = table.insertRow(table.rows.length); trHead.className = "header"; - $(trHead.insertCell(0)).text("Cluster Size"); - $(trHead.insertCell(1)).text("Row Count"); - $(trHead.insertCell(2)).text("Values in Cluster"); - $(trHead.insertCell(3)).text("Merge?"); - $(trHead.insertCell(4)).text("New Cell Value"); + $(trHead.insertCell(0)).text($.i18n._('core-dialogs')["cluster-size"]); + $(trHead.insertCell(1)).text($.i18n._('core-dialogs')["row-count"]); + $(trHead.insertCell(2)).text($.i18n._('core-dialogs')["cluster-values"]); + $(trHead.insertCell(3)).text($.i18n._('core-dialogs')["merge"]); + $(trHead.insertCell(4)).text($.i18n._('core-dialogs')["new-cell-val"]); var renderCluster = function(cluster) { var tr = table.insertRow(table.rows.length); @@ -159,7 +181,7 @@ ClusteringDialog.prototype._renderTable = function(clusters) { for (var c = 0; c < choices.length; c++) { var choice = choices[c]; var li = $('
  • '); - $('').text(choice.v).click(onClick).appendTo(li); + $('').text(choice.v).click(onClick).appendTo(li); $('').text("(" + choice.c + " rows)").addClass("clustering-dialog-entry-count").appendTo(li); rowCount += choice.c; facet.s[c] = { @@ -181,7 +203,7 @@ ClusteringDialog.prototype._renderTable = function(clusters) { var div = $('
    ').addClass("clustering-dialog-value-focus"); - var browseLink = $('Browse this cluster') + var browseLink = $(''+$.i18n._('core-dialogs')["browse-this-cluster"]+'') .addClass("clustering-dialog-browse-focus") .attr("href",url) .css("visibility","hidden") @@ -218,12 +240,12 @@ ClusteringDialog.prototype._renderTable = function(clusters) { this._elmts.resultSummary.html( (clusters.length === this._clusters.length) ? ("" + this._clusters.length + " cluster" + ((this._clusters.length != 1) ? "s" : "") + " found") : - ("" + clusters.length + " cluster" + ((clusters.length != 1) ? "s" : "") + " filtered from " + this._clusters.length + " total") + ("" + clusters.length + " cluster" + ((clusters.length != 1) ? "s" : "") + " "+$.i18n._('core-dialogs')["filtered-from"]+ this._clusters.length +$.i18n._('core-dialogs')["from-total"] ) ); } else { container.html( - '
    No clusters were found with the selected method
    Try selecting another method above or changing its parameters
    ' + '
    '+$.i18n._('core-dialogs')["no-cluster-found"]+'
    '+$.i18n._('core-dialogs')["try-another-method"]+'
    ' ); } }; @@ -232,7 +254,7 @@ ClusteringDialog.prototype._cluster = function() { var self = this; var container = this._elmts.tableContainer.html( - '
    Clustering...
    ' + '
    '+$.i18n._('core-dialogs')["clustering"]+'
    ' ); this._elmts.resultSummary.empty(); @@ -346,7 +368,7 @@ ClusteringDialog.prototype._apply = function(onDone) { } ); } else { - alert("You must check some Edit? checkboxes for your edits to be applied."); + alert($.i18n._('core-dialogs')["warning-check-boxes"]); } }; @@ -386,10 +408,10 @@ ClusteringDialog.prototype._resetFacets = function() { } this._facets = []; - this._createFacet("# Choices in Cluster", "size"); - this._createFacet("# Rows in Cluster", "rowCount"); - this._createFacet("Average Length of Choices", "avg"); - this._createFacet("Length Variance of Choices", "variance"); + this._createFacet($.i18n._('core-dialogs')["choices-in-cluster"], "size"); + this._createFacet($.i18n._('core-dialogs')["rows-in-cluster"], "rowCount"); + this._createFacet($.i18n._('core-dialogs')["choice-avg-length"], "avg"); + this._createFacet($.i18n._('core-dialogs')["choice-var-length"], "variance"); }; ClusteringDialog.prototype._createFacet = function(title, property) { diff --git a/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.html b/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.html index 92c7efbb8..383b852f3 100644 --- a/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.html @@ -1,9 +1,9 @@
    -
    Re-order / Remove Columns
    +
    - - + + @@ -11,7 +11,7 @@
    Drag columns to re-orderDrop columns here to remove
    \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.js b/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.js index 6bcde92b2..58f29ca3c 100644 --- a/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/column-reordering-dialog.js @@ -39,9 +39,16 @@ ColumnReorderingDialog.prototype._createDialog = function() { var self = this; var dialog = $(DOM.loadHTML("core", "scripts/dialogs/column-reordering-dialog.html")); this._elmts = DOM.bind(dialog); + this._elmts.cancelButton.click(function() { self._dismiss(); }); this._elmts.okButton.click(function() { self._commit(); }); + this._elmts.dialogHeader.html($.i18n._('core-dialogs')["reorder-column"]); + this._elmts.or_dialog_dragCol.html($.i18n._('core-dialogs')["drag-column"]); + this._elmts.or_dialog_dropCol.html($.i18n._('core-dialogs')["drop-column"]); + this._elmts.okButton.html($.i18n._('core-buttons')["ok"]); + this._elmts.cancelButton.html($.i18n._('core-buttons')["cancel"]); + this._level = DialogSystem.showDialog(dialog); for (var i = 0; i < theProject.columnModel.columns.length; i++) { diff --git a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html index 3cd5271bb..74c6f3d47 100644 --- a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.html @@ -1,91 +1,91 @@
    -
    Custom Tabular Exporter
    +
    - - + +
    Select and Order Columns to ExportOptions for
    - - @@ -94,48 +94,48 @@
    For reconciled cells, output
    + + - +
    - + - + - + - + - +
    For date/time values, use format
    - + - + - + - + - + - + - +
    - - Help + +
    - - + +
    - + - + - +
    - - + +
    Line-based text formatsOther formats
    - + - + -
    +
    - + - + - +
    - - + +
    Line separator
    Character encoding
    - - + +
    @@ -143,30 +143,27 @@ \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js index 7c17ff2c8..d1bc451c9 100644 --- a/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/custom-tabular-exporter-dialog.js @@ -82,6 +82,51 @@ CustomTabularExporterDialog.prototype._createDialog = function(options) { this._elmts.uploadTabBody.remove(); } + this._elmts.dialogHeader.html($.i18n._('core-dialogs')["custom-tab-exp"]); + this._elmts.or_dialog_content.html($.i18n._('core-dialogs')["content"]); + this._elmts.or_dialog_download.html($.i18n._('core-dialogs')["download"]); + this._elmts.or_dialog_upload.html($.i18n._('core-dialogs')["upload"]); + this._elmts.or_dialog_optCode.html($.i18n._('core-dialogs')["opt-code"]); + this._elmts.or_dialog_selAndOrd.html($.i18n._('core-dialogs')["sel-and-ord"]); + this._elmts.or_dialog_optFor.html($.i18n._('core-dialogs')["opt-for"]+" "); + this._elmts.or_dialog_forReconCell.html($.i18n._('core-dialogs')["for-recon-cell"]); + this._elmts.or_dialog_matchedName.html($.i18n._('core-dialogs')["match-ent-name"]); + this._elmts.or_dialog_cellCont.html($.i18n._('core-dialogs')["cell-content"]); + this._elmts.or_dialog_matchedId.html($.i18n._('core-dialogs')["match-ent-id"]); + this._elmts.or_dialog_linkMatch.html($.i18n._('core-dialogs')["link-match"]); + this._elmts.or_dialog_outNotUnMatch.html($.i18n._('core-dialogs')["out-not-unmatch"]); + this._elmts.or_dialog_dateIso.html($.i18n._('core-dialogs')["date-iso"]); + this._elmts.or_dialog_shortFormat.html($.i18n._('core-dialogs')["short-format"]); + this._elmts.or_dialog_mediumFormat.html($.i18n._('core-dialogs')["medium-format"]); + this._elmts.or_dialog_longFormat.html($.i18n._('core-dialogs')["long-format"]); + this._elmts.or_dialog_fullFormat.html($.i18n._('core-dialogs')["full-format"]); + this._elmts.or_dialog_custom.html($.i18n._('core-dialogs')["custom"]); + this._elmts.or_dialog_help.html($.i18n._('core-dialogs')["help"]); + this._elmts.or_dialog_localTime.html($.i18n._('core-dialogs')["local-time"]); + this._elmts.or_dialog_omitTime.html($.i18n._('core-dialogs')["omit-time"]); + this._elmts.selectAllButton.html($.i18n._('core-buttons')["select-all"]); + this._elmts.deselectAllButton.html($.i18n._('core-buttons')["deselect-all"]); + this._elmts.or_dialog_outColHeader.html($.i18n._('core-dialogs')["out-col-header"]); + this._elmts.or_dialog_outEmptyRow.html($.i18n._('core-dialogs')["out-empty-row"]); + this._elmts.or_dialog_ignoreFacets.html($.i18n._('core-dialogs')["ignore-facets"]); + this._elmts.or_dialog_lineFormat.html($.i18n._('core-dialogs')["line-based"]); + this._elmts.or_dialog_otherFormat.html($.i18n._('core-dialogs')["other-format"]); + this._elmts.or_dialog_tsv.html($.i18n._('core-dialogs')["tsv"]); + this._elmts.or_dialog_csv.html($.i18n._('core-dialogs')["csv"]); + this._elmts.or_dialog_customSep.html($.i18n._('core-dialogs')["custom-separator"]); + this._elmts.or_dialog_excel.html($.i18n._('core-dialogs')["excel"]); + this._elmts.or_dialog_excelXml.html($.i18n._('core-dialogs')["excel-xml"]); + this._elmts.or_dialog_htmlTable.html($.i18n._('core-dialogs')["html-table"]); + this._elmts.or_dialog_lineSep.html($.i18n._('core-dialogs')["line-sep"]); + this._elmts.or_dialog_charEnc.html($.i18n._('core-dialogs')["char-enc"]); + this._elmts.downloadPreviewButton.html($.i18n._('core-buttons')["preview"]); + this._elmts.downloadButton.html($.i18n._('core-buttons')["download"]); + this._elmts.downloadButton.html($.i18n._('core-dialog')["upload-to"]); + this._elmts.uploadButton.html($.i18n._('core-buttons')["upload"]); + this._elmts.or_dialog_jsonText.html($.i18n._('core-dialogs')["json-text"]); + this._elmts.applyOptionCodeButton.html($.i18n._('core-buttons')["apply"]); + this._elmts.cancelButton.html($.i18n._('core-buttons')["cancel"]); + $("#custom-tabular-exporter-tabs-content").css("display", ""); $("#custom-tabular-exporter-tabs-download").css("display", ""); $("#custom-tabular-exporter-tabs-upload").css("display", ""); @@ -326,9 +371,9 @@ CustomTabularExporterDialog.prototype._applyOptionCode = function() { var json = JSON.parse(s); this._configureUIFromOptionCode(json); - alert('Option code successfully applied.'); + alert($.i18n._('core-dialogs')["opt-code-applied"]); } catch (e) { - alert('Error applying option code: ' + e); + alert($.i18n._('core-dialogs')["error-apply-code"]+': ' + e); } }; diff --git a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html index c2cbbf650..258cfadd8 100644 --- a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.html @@ -1,7 +1,7 @@
    - - + + @@ -12,10 +12,10 @@
    ExpressionLanguage
    diff --git a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js index 1cdbe11e1..0d18bfa79 100644 --- a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js @@ -45,12 +45,12 @@ function ExpressionPreviewDialog(title, cellIndex, rowIndices, values, expressio this._elmts = DOM.bind(html); - $('').html("  OK  ").click(function() { + $('').html($.i18n._('core-buttons')["ok"]).click(function() { DialogSystem.dismissUntil(self._level - 1); self._onDone(self._previewWidget.getExpression(true)); }).appendTo(footer); - $('').text("Cancel").click(function() { + $('').text($.i18n._('core-buttons')["cancel"]).click(function() { DialogSystem.dismissUntil(self._level - 1); }).appendTo(footer); @@ -139,6 +139,13 @@ ExpressionPreviewDialog.Widget = function( this._tabContentWidth = this._elmts.expressionPreviewPreviewContainer.width() + "px"; + this._elmts.or_dialog_expr.html($.i18n._('core-dialogs')["expression"]); + this._elmts.or_dialog_lang.html($.i18n._('core-dialogs')["language"]); + this._elmts.or_dialog_preview.html($.i18n._('core-dialogs')["preview"]); + this._elmts.or_dialog_history.html($.i18n._('core-dialogs')["history"]); + this._elmts.or_dialog_starred.html($.i18n._('core-dialogs')["starred"]); + this._elmts.or_dialog_help.html($.i18n._('core-dialogs')["help"]); + this.update(); this._renderExpressionHistoryTab(); this._renderStarredExpressionsTab(); @@ -188,21 +195,19 @@ ExpressionPreviewDialog.Widget.prototype._renderHelp = function(data) { var varTable = $('
    ').appendTo(elmt)[0]; var vars = [ { name: "cell", - description: "The current cell. It has a few fields: 'value' and 'recon'." + description: $.i18n._('core-dialogs')["cell-fields"] }, { name: "value", - description: "The current cell's value. This is a shortcut for 'cell.value'." + description: $.i18n._('core-dialogs')["cell-value"] }, { name: "row", - description: "The current row. It has 5 fields: 'flagged', 'starred', 'index', 'cells', and 'record'." + description: $.i18n._('core-dialogs')["row-fields"] }, { name: "cells", - description: "The cells of the current row. This is a shortcut for 'row.cells'. " + - "A particular cell can be retrieved with 'cells.' if the is a single word, " + - "or with 'cells[\"\"] otherwise." + description: $.i18n._('core-dialogs')["cells-of-row"] }, { name: "rowIndex", - description: "The current row's index. This is a shortcut for 'row.index'." + description: $.i18n._('core-dialogs')["row-index"] } ]; for (var i = 0; i < vars.length; i++) { @@ -221,7 +226,7 @@ ExpressionPreviewDialog.Widget.prototype._renderHelp = function(data) { $(tr0.insertCell(1)).addClass("expression-preview-doc-item-params").text("(" + entry.params + ")"); $(tr1.insertCell(0)); - $(tr1.insertCell(1)).addClass("expression-preview-doc-item-returns").text("returns: " + entry.returns); + $(tr1.insertCell(1)).addClass("expression-preview-doc-item-returns").text($.i18n._('core-dialogs')["returns"]+": " + entry.returns); $(tr2.insertCell(0)); $(tr2.insertCell(1)).addClass("expression-preview-doc-item-desc").text(entry.description); @@ -268,7 +273,7 @@ ExpressionPreviewDialog.Widget.prototype._renderExpressionHistory = function(dat var table = $( '' + - '' + + '' + '
    FromExpression
    '+$.i18n._('core-dialogs')["from"]+''+$.i18n._('core-dialogs')["expression"]+'
    ' ).appendTo($('
    ').addClass("expression-preview-table-wrapper").appendTo(elmt))[0]; @@ -291,7 +296,7 @@ ExpressionPreviewDialog.Widget.prototype._renderExpressionHistory = function(dat ); }); - $('Reuse').appendTo(tr.insertCell(1)).click(function() { + $(''+$.i18n._('core-dialogs')["reuse"]+'').appendTo(tr.insertCell(1)).click(function() { self._elmts.expressionPreviewTextarea[0].value = o.expression; self._elmts.expressionPreviewLanguageSelect[0].value = o.language; @@ -334,7 +339,7 @@ ExpressionPreviewDialog.Widget.prototype._renderStarredExpressions = function(da var table = $( '' + - '' + + '' + '
    Expression
    '+$.i18n._('core-dialogs')["expression"]+'
    ' ).appendTo($('
    ').addClass("expression-preview-table-wrapper").appendTo(elmt))[0]; @@ -342,7 +347,7 @@ ExpressionPreviewDialog.Widget.prototype._renderStarredExpressions = function(da var tr = table.insertRow(table.rows.length); var o = Scripting.parse(entry.code); - $('Remove').appendTo(tr.insertCell(0)).click(function() { + $(''+$.i18n._('core-dialogs')["remove"]+'').appendTo(tr.insertCell(0)).click(function() { $.post( "command/core/toggle-starred-expression", { expression: entry.code, returnList: true }, @@ -427,7 +432,7 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d var renderValue = function(td, v) { if (v !== null && v !== undefined) { if ($.isPlainObject(v)) { - $('').addClass("expression-preview-special-value").text("Error: " + v.message).appendTo(td); + $('').addClass("expression-preview-special-value").text($.i18n._('core-dialogs')["error"]+": " + v.message).appendTo(td); } else { td.text(v); } @@ -437,9 +442,9 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d }; if (this._results !== null) { - this._elmts.expressionPreviewParsingStatus.empty().removeClass("error").text("No syntax error."); + this._elmts.expressionPreviewParsingStatus.empty().removeClass("error").text($.i18n._('core-dialogs')["no-syntax-err"]+"."); } else { - var message = (data.type == "parser") ? data.message : "Internal error"; + var message = (data.type == "parser") ? data.message : $.i18n._('core-dialogs')["internal-err"]; this._elmts.expressionPreviewParsingStatus.empty().addClass("error").text(message); } diff --git a/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.html b/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.html index b202296b4..400a53e81 100644 --- a/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.html @@ -12,29 +12,29 @@
    - - + +
    - - - + + +
    - - - + + +
    - +
    diff --git a/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.js b/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.js index 1d063bb56..a5a717c40 100644 --- a/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/scatterplot-dialog.js @@ -43,10 +43,19 @@ ScatterplotDialog.prototype._createDialog = function() { var dialog = $(DOM.loadHTML("core", "scripts/dialogs/scatterplot-dialog.html")); this._elmts = DOM.bind(dialog); this._elmts.dialogHeader.text( - 'Scatterplot Matrix' + - ((typeof this._column == "undefined") ? "" : " (focusing on '" + this._column + "')")); + $.i18n._('core-dialogs')["scatterplot-matrix"] + + ((typeof this._column == "undefined") ? "" : " ("+$.i18n._('core-dialogs')["focusing-on"]+" '" + this._column + "')")); this._elmts.closeButton.click(function() { self._dismiss(); }); + this._elmts.or_dialog_linplot.attr("title", $.i18n._('core-dialogs')["linear-plot"]); + this._elmts.or_dialog_logplot.attr("title", $.i18n._('core-dialogs')["logarithmic-plot"]); + this._elmts.or_dialog_counter.attr("title", $.i18n._('core-dialogs')["rotated-counter-clock"]); + this._elmts.or_dialog_norot.attr("title", $.i18n._('core-dialogs')["no-rotation"]); + this._elmts.or_dialog_clock.attr("title", $.i18n._('core-dialogs')["rotated-clock"]); + this._elmts.or_dialog_smallDot.attr("title", $.i18n._('core-dialogs')["small-dot"]); + this._elmts.or_dialog_regularDot.attr("title", $.i18n._('core-dialogs')["regular-dot"]); + this._elmts.or_dialog_bigDot.attr("title", $.i18n._('core-dialogs')["big-dot"]); + this._elmts.closeButton.text($.i18n._('core-buttons')["close"]); this._elmts.plotSelector.buttonset().change(function() { self._plot_method = $(this).find("input:checked").val(); @@ -78,7 +87,7 @@ ScatterplotDialog.prototype._renderMatrix = function() { var self = this; var container = this._elmts.tableContainer.html( - '
    Processing...
    ' + '
    '+$.i18n._('core-dialogs')["focusing-on"]+'
    ' ); if (theProject.columnModel.columns.length > 0) { @@ -87,7 +96,7 @@ ScatterplotDialog.prototype._renderMatrix = function() { }; $.getJSON("command/core/get-columns-info?" + $.param(params),function(data) { if (data === null || typeof data.length == 'undefined') { - container.html("Error calling 'get-columns-info'"); + container.html($.i18n._('core-dialogs')["error-getColumnInfo"]); return; } @@ -205,7 +214,7 @@ ScatterplotDialog.prototype._renderMatrix = function() { }); } else { container.html( - '
    There are no columns in this dataset
    ' + '
    '+$.i18n._('core-dialogs')["no-column-dataset"]+ '
    ' ); } diff --git a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.html b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.html index 948f70863..42514f346 100644 --- a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.html @@ -1,16 +1,16 @@
    -
    Templating Export
    +
    - + - + - + - +
    Prefix
    Row Template
    Row Separator
    Suffix
    @@ -21,11 +21,11 @@ \ No newline at end of file diff --git a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js index 4fb30f7e7..2758fa5cd 100644 --- a/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/templating-exporter-dialog.js @@ -43,6 +43,15 @@ TemplatingExporterDialog.prototype._createDialog = function() { this._elmts = DOM.bind(dialog); this._elmts.controls.find("textarea").bind("keyup change input",function() { self._scheduleUpdate(); }); + this._elmts.dialogHeader.html($.i18n._('core-dialogs')["template-export"]); + this._elmts.or_dialog_prefix.html($.i18n._('core-dialogs')["template-prefix"]); + this._elmts.or_dialog_rowTmpl.html($.i18n._('core-dialogs')["template-rowt"]); + this._elmts.or_dialog_rowSep.html($.i18n._('core-dialogs')["template-rows"]); + this._elmts.or_dialog_suffix.html($.i18n._('core-dialogs')["template-suffix"]); + this._elmts.resetButton.html($.i18n._('core-buttons')["reset-template"]); + this._elmts.exportButton.html($.i18n._('core-buttons')["export"]); + this._elmts.cancelButton.html($.i18n._('core-buttons')["cancel"]); + this._elmts.exportButton.click(function() { self._export(); self._dismiss(); }); this._elmts.cancelButton.click(function() { self._dismiss(); }); this._elmts.resetButton.click(function() { @@ -98,10 +107,10 @@ TemplatingExporterDialog.prototype._scheduleUpdate = function() { window.clearTimeout(this._timerID); } - this._elmts.previewTextarea[0].value = "Idling..."; + this._elmts.previewTextarea[0].value = $.i18n._('core-dialogs')["idling"]; this._timerID = window.setTimeout(function() { self._timerID = null; - self._elmts.previewTextarea[0].value = "Updating..."; + self._elmts.previewTextarea[0].value = $.i18n._('core-dialogs')["updating"]; self._updatePreview(); }, 1000); }; diff --git a/main/webapp/modules/core/scripts/project.js b/main/webapp/modules/core/scripts/project.js index ad1866b23..1fa66cb40 100644 --- a/main/webapp/modules/core/scripts/project.js +++ b/main/webapp/modules/core/scripts/project.js @@ -34,6 +34,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var theProject; var ui = {}; +var lang = navigator.language.split("-")[0] + || navigator.userLanguage.split("-")[0]; +var dictionary = ""; +$.ajax({ + url : "/command/core/load-language?", + type : "POST", + async : false, + data : { + // lng : lang + lng : 'en' + }, + success : function(data) { + dictionary = data; + } +}); +$.i18n.setDictionary(dictionary); +// End internationalization + var Refine = { refineHelperService: "http://openrefine-helper.freebaseapps.com" }; diff --git a/main/webapp/modules/langs/translation-en.json b/main/webapp/modules/langs/translation-en.json index ceb91bfe5..0b837ec3a 100644 --- a/main/webapp/modules/langs/translation-en.json +++ b/main/webapp/modules/langs/translation-en.json @@ -120,12 +120,131 @@ "encoding": "Encoding", "aliases": "Aliases" }, + "core-dialogs": { + "cluster-edit": "Cluster & Edit column", + "cluster-size": "Cluster Size", + "row-count": "Row Count", + "cluster-values": "Values in Cluster", + "merge": "Merge?", + "new-cell-val": "New Cell Value", + "use-this-val": "Use this value", + "browse-only-these": "Browse only these values", + "browse-this-cluster": "Browse this cluster", + "no-cluster-found": "No clusters were found with the selected method", + "try-another-method": "Try selecting another method above or changing its parameters", + "clustering": "Clustering... ", + "warning-check-boxes": "You must check some Edit? checkboxes for your edits to be applied.", + "choices-in-cluster": "# Choices in Cluster", + "rows-in-cluster": "# Rows in Cluster", + "choice-avg-length": "Average Length of Choices", + "choice-var-length": "Length Variance of Choices", + "filtered-from": "filtered from ", + "from-total": " total", + "cluster-descr": "This feature helps you find groups of different cell values that might be alternative representations of the same thing. For example, the two strings \"New York\" and \"new york\" are very likely to refer to the same concept and just have capitalization differences, and \"Gödel\" and \"Godel\" probably refer to the same person.", + "find-more": "Find out more ...", + "method": "Method ", + "key-collision": "key collision", + "nearest-neighbor": "nearest neighbor", + "keying-function": "Keying Function ", + "fingerprint": "fingerprint", + "ngram": "ngram-fingerprint", + "metaphone": "metaphone3", + "phonetic": "cologne-phonetic", + "distance-fun": "Distance Function ", + "leven": "levenshtein", + "ppm" : "PPM", + "ngram-size": "Ngram Size ", + "ngram-radius": "Radius ", + "block-chars": "Block Chars ", + "reorder-column": "Re-order / Remove Columns", + "drag-column": "Drag columns to re-order", + "drop-column": "Drop columns here to remove", + "template-export": "Templating Export", + "template-prefix": "Prefix", + "template-rowt": "Row Template", + "template-rows": "Row Separator", + "template-suffix": "Suffix", + "idling": "Idling...", + "updating": "Updating...", + "scatterplot-matrix": "Scatterplot Matrix", + "focusing-on": "focusing on", + "processing": "Processing...", + "error-getColumnInfo": "Error calling 'get-columns-info'", + "no-column-dataset": "There are no columns in this dataset", + "linear-plot": "Linear Plot", + "logarithmic-plot": "Logarithmic Plot", + "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", + "cell-fields": "The current cell. It has a few fields: 'value' and 'recon'.", + "cell-value": "The current cell's value. This is a shortcut for 'cell.value'.", + "row-fields": "The current row. It has 5 fields: 'flagged', 'starred', 'index', 'cells', and 'record'.", + "cells-of-row": "The cells of the current row. This is a shortcut for 'row.cells'. A particular cell can be retrieved with 'cells.' if the is a single word, or with 'cells[\"\"] otherwise.", + "row-index": "The current row's index. This is a shortcut for 'row.index'.", + "returns": "returns", + "from": "From", + "expression": "Expression", + "reuse": "Reuse", + "remove": "Remove", + "error": "Error", + "no-syntax-err": "No syntax error", + "internal-err": "Internal error", + "language": "Language", + "preview": "Preview", + "history": "History", + "starred": "Starred", + "help": "Help", + "opt-code-applied": "Option code successfully applied.", + "error-apply-code": "Error applying option code", + "custom-tab-exp": "Custom Tabular Exporter", + "content": "Content", + "download": "Download", + "upload": "Upload", + "opt-code": "Option Code", + "sel-and-ord": "Select and Order Columns to Export", + "opt-for": "Options for", + "for-recon-cell": "For reconciled cells, output", + "match-ent-name": "Matched entity's name", + "cell-content": "Cell's content", + "match-ent-id": "Matched entity's ID", + "link-match": "Link to matched entity's page", + "out-not-unmatch": "Output nothing for unmatched cells", + "date-format": "For date/time values, use format", + "date-iso": "ISO 8601, e.g., 2011-08-24T18:36:10+08:00", + "short-format": "Short locale format", + "medium-format": "Medium locale format", + "long-format": "Long locale format", + "full-format": "Full locale format", + "custom": "Custom", + "help": "Help", + "local-time": "Use local time zone", + "omit-time": "Omit time", + "out-col-header": "Output column headers", + "out-empty-row": "Output empty rows (ie all cells null)", + "ignore-facets": "Ignore facets and filters and export all rows", + "line-based": "Line-based text formats", + "other-format": "Other formats", + "tsv": "Tab-separated values (TSV)", + "csv": "Comma-separated values (CSV)", + "custom-separator": "Custom separator", + "excel": "Excel (.xls)", + "excel-xml": "Excel in XML (.xlsx)", + "html-table": "HTML table", + "char-enc": "Character encoding", + "line-sep": "Line separator", + "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." + }, "core-buttons": { "cancel": "Cancel", - "ok": "OK", + "ok": "  OK  ", "import-proj": "Import Project", "select-all": "Select All", "unselect-all": "Unselect All", + "deselect-all": "De-select All", "select": "Select", "unselect": "Unselect", "startover": "« Start Over", @@ -135,6 +254,15 @@ "next": "Next »", "add-url": "Add Another URL", "update-preview": "Update Preview", - "pick-record": "Pick Record Elements" + "pick-record": "Pick Record Elements", + "merge-cluster": "Merge Selected & Re-Cluster", + "merge-close": "Merge Selected & Close", + "close": "Close", + "reset-template": "Reset Template", + "export": "Export", + "preview": "Preview", + "download": "Download", + "upload": "Upload", + "apply": "Apply" } } \ No newline at end of file