From 9db113faa242a2ace1fe2598c3b9e15827174bf2 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sat, 15 Jul 2017 10:23:31 +0100 Subject: [PATCH] Localization --- .../webapp/modules/core/MOD-INF/controller.js | 1 + .../core/langs/translation-default.json | 7 +++ .../modules/core/langs/translation-en.json | 7 +++ .../modules/core/langs/translation-es.json | 7 +++ .../modules/core/langs/translation-fr.json | 7 +++ .../modules/core/langs/translation-it.json | 7 +++ .../dialogs/extend-data-preview-dialog.js | 20 ++++---- .../views/data-table/menu-edit-column.js | 46 +------------------ 8 files changed, 49 insertions(+), 53 deletions(-) diff --git a/main/webapp/modules/core/MOD-INF/controller.js b/main/webapp/modules/core/MOD-INF/controller.js index 08b76e2fc..4489d0c97 100644 --- a/main/webapp/modules/core/MOD-INF/controller.js +++ b/main/webapp/modules/core/MOD-INF/controller.js @@ -182,6 +182,7 @@ function registerOperations() { OR.registerOperation(module, "recon-judge-similar-cells", Packages.com.google.refine.operations.recon.ReconJudgeSimilarCellsOperation); OR.registerOperation(module, "recon-clear-similar-cells", Packages.com.google.refine.operations.recon.ReconClearSimilarCellsOperation); OR.registerOperation(module, "recon-copy-across-columns", Packages.com.google.refine.operations.recon.ReconCopyAcrossColumnsOperation); + OR.registerOperation(module, "extend-reconciled-data", Packages.com.google.refine.operations.recon.ExtendDataOperation); } function registerImporting() { diff --git a/main/webapp/modules/core/langs/translation-default.json b/main/webapp/modules/core/langs/translation-default.json index ceab109be..48cebf3be 100644 --- a/main/webapp/modules/core/langs/translation-default.json +++ b/main/webapp/modules/core/langs/translation-default.json @@ -503,6 +503,13 @@ "cache-responses": "Cache responses", "copy-val": "copy value from original column", "warning-col-name": "You must enter a column name.", + "add-col-recon-val": "Add columns from reconciled values", + "add-col-recon-col": "Add columns from reconciled column", + "warning-no-property": "Please select a property first.", + "configure-col": "Configure this column", + "remove-prop": "remove", + "configure-prop": "configure", + "no-settings": "No settings are available for this property.", "add-col-fetch": "Add column by fetching URLs based on column", "throttle-delay": "Throttle delay", "milli": "milliseconds", diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index 6f13a1bdb..ae836fb8d 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -503,6 +503,13 @@ "cache-responses": "Cache responses", "copy-val": "copy value from original column", "warning-col-name": "You must enter a column name.", + "add-col-recon-val": "Add columns from reconciled values", + "add-col-recon-col": "Add columns from reconciled column", + "warning-no-property": "Please select a property first.", + "configure-col": "Configure this column", + "remove-prop": "remove", + "configure-prop": "configure", + "no-settings": "No settings are available for this property.", "add-col-fetch": "Add column by fetching URLs based on column", "throttle-delay": "Throttle delay", "milli": "milliseconds", diff --git a/main/webapp/modules/core/langs/translation-es.json b/main/webapp/modules/core/langs/translation-es.json index 98a8d6598..ab4f88dae 100644 --- a/main/webapp/modules/core/langs/translation-es.json +++ b/main/webapp/modules/core/langs/translation-es.json @@ -502,6 +502,13 @@ "store-err": "guardar error", "copy-val": "copiar valor de la columna original", "warning-col-name": "Debe ingresar un nombre para la columna.", + "add-col-recon-val": "Añadir columnas de valores conciliados", + "add-col-recon-col": "Añadir columnas de la columna conciliada", + "warning-no-property": "Seleccione primero una propiedad.", + "configure-col": "Configurar esta columna", + "remove-prop": "retirar", + "configure-prop": "configurar", + "no-settings": "No hay configuraciones disponibles para esta propiedad.", "add-col-fetch": "Agregar columna accediendo a URls basada en la columna", "throttle-delay": "Tiempo de retraso", "milli": "milisegundos", diff --git a/main/webapp/modules/core/langs/translation-fr.json b/main/webapp/modules/core/langs/translation-fr.json index 525e50292..02153c3e6 100644 --- a/main/webapp/modules/core/langs/translation-fr.json +++ b/main/webapp/modules/core/langs/translation-fr.json @@ -504,6 +504,13 @@ "copy-val": "copier la valeur depuis la colonne originale", "warning-col-name": "Vous devez indiquer un nom de colonne.", "add-col-fetch": "Ajouter une colonne en moissonnant les données depuis les URL d’une colonne", + "add-col-recon-val": "Ajouter des colonnes à partir de valeurs réconciliées", + "add-col-recon-col": "Ajouter des colonnes à partir de la colonne", + "warning-no-property": "Veuillez d'abord sélectionner une propriété.", + "configure-col": "Configurer cette colonne", + "remove-prop": "supprimer", + "configure-prop": "configurer", + "no-settings": "Aucun paramètre n'est disponible pour cette propriété.", "throttle-delay": "Délai de récupération", "milli": "millisecondes", "url-fetch": "Indiquer les URL à moissonner :", diff --git a/main/webapp/modules/core/langs/translation-it.json b/main/webapp/modules/core/langs/translation-it.json index 022ab88a1..5cd320aff 100644 --- a/main/webapp/modules/core/langs/translation-it.json +++ b/main/webapp/modules/core/langs/translation-it.json @@ -502,6 +502,13 @@ "store-err": "salva l'errore", "copy-val": "copia il valore dalla colonna originale", "warning-col-name": "Inserisci un nome per la colonna.", + "add-col-recon-val": "Aggiungi colonne da valori riconciliati", + "add-col-recon-col": "Aggiungi colonne dalla colonna riconciliata", + "warning-no-property": "Per favore seleziona innanzitutto una proprietà.", + "configure-col": "Configurare questa colonna", + "remove-prop": "rimuovi", + "configure-prop": "configurare", + "no-settings": "Nessuna impostazione sono disponibili per questa proprietà.", "add-col-fetch": "Aggiungi colonna con URL, basandoti su", "throttle-delay": "Durata Throttle", "milli": "millisecondi", diff --git a/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js b/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js index fe3702014..2aa6f9e66 100644 --- a/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/extend-data-preview-dialog.js @@ -41,7 +41,7 @@ function ExtendReconciledDataPreviewDialog(column, columnIndex, rowIndices, onDo var self = this; this._dialog = $(DOM.loadHTML("core", "scripts/views/data-table/extend-data-preview-dialog.html")); this._elmts = DOM.bind(this._dialog); - this._elmts.dialogHeader.html("Add columns by reconciled column " + column.name); + this._elmts.dialogHeader.html($.i18n._('core-views')["add-col-recon-col"]+" "+column.name); this._elmts.resetButton.click(function() { self._extension.properties = []; self._update(); @@ -49,7 +49,7 @@ function ExtendReconciledDataPreviewDialog(column, columnIndex, rowIndices, onDo this._elmts.okButton.click(function() { if (self._extension.properties.length === 0) { - alert("Please add some properties first."); + alert($.i18n._('core-views')["warning-no-property"]); } else { DialogSystem.dismissUntil(self._level - 1); self._onDone(self._extension, @@ -253,17 +253,17 @@ ExtendReconciledDataPreviewDialog.prototype._renderPreview = function(data) { $('
').appendTo(th); $('') - .text("remove") + .text($.i18n("core-views")["remove-prop"]) .addClass("action") - .attr("title", "Remove this column") + .attr("title", $.i18n("core-views")["remove-col"]) .click(function() { self._removeProperty(column.id); }).appendTo(th); $('') - .text("configure") + .text($.i18n("core-views")["configure-prop"]) .addClass("action") - .attr("title", "Configure this column") + .attr("title", $.i18n("core-views")["configure-col"]) .click(function() { self._constrainProperty(column.id); }).appendTo(th); @@ -372,6 +372,10 @@ ExtendReconciledDataPreviewDialog.prototype._constrainProperty = function(id) { form += ''; } } + + if (form == '') { + form = ''+$.i18n('core-views')['no-settings']+'' + } } body.html( @@ -390,8 +394,8 @@ ExtendReconciledDataPreviewDialog.prototype._constrainProperty = function(id) { } footer.html( - '' + - '' + '' + + '' ); var footerElmts = DOM.bind(footer); diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js index 0a327bc51..015bb84fd 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-edit-column.js @@ -173,50 +173,6 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { ); }; -/* - var doAddColumnByReconciliation = function() { - var frame = $( - DOM.loadHTML("core", "scripts/views/data-table/add-column-by-reconciliation.html")); - - var elmts = DOM.bind(frame); - elmts.dialogHeader.text($.i18n._('core-views')["add-by-recon"]); - - elmts.suggestedPropertyHeader.html('Suggested properties'); - elmts.previewHeader.html('Preview'); - elmts.addPropertyHeader.html('Add property'); - elmts.okButton.html($.i18n._('core-buttons')["ok"]); - elmts.cancelButton.text($.i18n._('core-buttons')["cancel"]); - - var level = DialogSystem.showDialog(frame); - var dismiss = function() { DialogSystem.dismissUntil(level - 1); }; - - elmts.cancelButton.click(dismiss); - elmts.okButton.click(function() { - var columnName = $.trim(elmts.columnNameInput[0].value); - if (!columnName.length) { - alert($.i18n._('core-views')["warning-col-name"]); - return; - } - - Refine.postCoreProcess( - "add-column-by-fetching-urls", - { - baseColumnName: column.name, - urlExpression: previewWidget.getExpression(true), - newColumnName: columnName, - columnInsertIndex: columnIndex + 1, - delay: elmts.throttleDelayInput[0].value, - onError: $('input[name="dialog-onerror-choice"]:checked')[0].value, - cacheResponses: $('input[name="dialog-cache-responses"]')[0].checked, - }, - null, - { modelsChanged: true } - ); - dismiss(); - }); - }; -*/ - var doRemoveColumn = function() { Refine.postCoreProcess( "remove-column", @@ -371,7 +327,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { }, { id: "core/add-column-by-reconciliation", - label: $.i18n._('core-views')["add-by-recon"]+"...", + label: $.i18n._('core-views')["add-col-recon-val"]+"...", click: doAddColumnByReconciliation }, {},