Merge pull request #3 from Blakko/internationalization

Resolved conflicts with master branch
This commit is contained in:
Blakko 2013-07-25 02:13:29 -07:00
commit 553690b5cd
135 changed files with 4406 additions and 964 deletions

View File

@ -59,6 +59,7 @@ function init() {
RS.registerCommand(module, "import-qa-data", new Packages.com.google.refine.freebase.commands.ImportQADataCommand()); RS.registerCommand(module, "import-qa-data", new Packages.com.google.refine.freebase.commands.ImportQADataCommand());
RS.registerCommand(module, "mqlread", new Packages.com.google.refine.freebase.commands.MQLReadCommand()); RS.registerCommand(module, "mqlread", new Packages.com.google.refine.freebase.commands.MQLReadCommand());
RS.registerCommand(module, "mqlwrite", new Packages.com.google.refine.freebase.commands.MQLWriteCommand()); RS.registerCommand(module, "mqlwrite", new Packages.com.google.refine.freebase.commands.MQLWriteCommand());
RS.registerCommand(module, "load-language", new Packages.com.google.refine.freebase.commands.LoadLanguageCommand());
var OR = Packages.com.google.refine.operations.OperationRegistry; var OR = Packages.com.google.refine.operations.OperationRegistry;

View File

@ -0,0 +1,115 @@
{
"fb-schema-alignment": {
"close-confirm": "There are unsaved changes. Close anyway?",
"status-warning": "There are unsaved changes.",
"assert-link-found": "Assert link when 'true' is found in column",
"search-pick-property": "Search for a property or pick one below",
"search-property": "Search for a property",
"cell": "cell",
"cells": "cells",
"which-column": "Which column?",
"configure": "Configure...",
"which-topic": "Which topic?",
"what-value": "What value?",
"anonymous": "anonymous",
"add-property": "add property",
"anonymous-node": "Anonymous Node",
"freebase-topic": "Freebase Topic",
"value": "Value",
"skeleton-node": "Schema Alignment Skeleton Node",
"text": "text",
"int": "int",
"float": "float",
"double": "double",
"boolean": "boolean",
"date-time": "date/time",
"rawstring": "rawstring",
"set-to-cell": "Set to Cell in Column",
"cell-content-used": "The cell's content is used ...",
"specify-fb-topic": "to specify a Freebase topic, as reconciled",
"type-new-topics": "Type new topics as",
"literal-value": "as a literal value",
"literal-type": "Literal type",
"text-language": "Text language",
"key-namespace": "as a key in a namespace",
"namespace": "Namespace",
"generate-anonymous": "Generate an anonymous graph node",
"assign-type": "Assign a type to the node",
"use-existing-topic": "Use one existing Freebase topic",
"value-type": "Value type",
"language": "Language",
"use-literal-value": "Use a literal value",
"column-warning": "You must select at least one column",
"new-node-warning": "For creating a new graph node, you need to specify a type for it.",
"namespace-warning": "Please specify the namespace.",
"anonymous-node-warning": "For generating an anonymous graph node, you need to specify a type for it",
"specify-topic-warning": "Please specify which existing Freebase topic to use",
"specify-value-warning": "Please specify the value to use"
},
"fb-interface": {
"dialog-header": "Align to Freebase's Schemas",
"body-text": "The schema alignment skeleton below specifies how your grid-shaped data will be transformed into graph-shaped data in Freebase's schemas.",
"find-more": "Find out more ...",
"skeleton": "Skeleton",
"mql-preview": "MQL-like Preview",
"tripleloader-preview": "TripleLoader Preview"
},
"fb-dialogs": {
"sign-in": "Sign into Freebase",
"enable-loading": "to enable loading",
"error-new-topic": "Error creating new topic",
"error-loading-data": "Error loading data",
"add-info-source": "Click here to add a new information source",
"dialog-header": "Load Data into Freebase",
"no-triples-dataset": "This dataset has no triples",
"warning-aligned": "Have you aligned it with Freebase's schemas yet?",
"name-of-data": "Name of data load",
"source-id": "Source ID (optional)",
"bodytext-1": "Note: Your data will only be loaded into",
"bodytext-2": "Sandbox is where everyone can experiment with Freebase technologies without disruption to the official",
"bodytext-3": "Sandbox gets",
"sandbox-link": " Sandbox",
"freebase-link": " Freebase",
"refreshed-link": " refreshed periodically",
"bodytext-4": "In order to load your data into the official Freebase, you must first load it into Sandbox. Then it must pass a Quality Assurance (QA) process before it can be loaded into Freebase proper.",
"quality-assurance": "Quality assurance",
"bodytext-5": "After loaded into Sandbox, enlist other people's help to double-check this data load's quality so that it can be loaded into Freebase.",
"triple-schedule": "triples successfully scheduled for loading",
"follow-progress": "Follow the loading progress in the ",
"refinery-link": "Freebase Refinery",
"signed-as": "Signed in as:",
"sign-out": "Sign Out"
},
"fb-qa": {
"header": "QA Data Load?",
"bodytext-1": "Other people will be enlisted to help double-check your data load for quality assurance purposes. Their time and labor have a cost.",
"bodytext-2": "You yourself should have taken all reasonable measures to eliminate errors from your data load. Your prudence is greatly appreciated.",
"tell-more": "Tell me more ...",
"ok-button": "Yes, QA Data Load"
},
"fb-extend": {
"add-column": "Add Columns from Freebase Based on Column",
"warning-add-properties": "Please add some properties first.",
"querying-freebase": "Querying Freebase ...",
"remove-column": "Remove this column",
"add-constraints": "Add constraints to this column",
"mql-constraints": "Enter MQL query constraints as JSON",
"warning-valid-json": "Please ensure that the JSON you enter is valid.",
"warning-json-obj": "The JSON you enter must be an object, that is, it is of this form { ... }.",
"add-property": "Add Property",
"suggested-properties": "Suggested Properties",
"constraint": "Constraint"
},
"fb-buttons": {
"save": "Save",
"save-load": "Save & Load",
"close": "Close",
"reset": "Reset",
"cancel": "Cancel",
"align-now": "Align Now",
"settings": "Settings",
"preview": "Preview",
"load-sandbox": "Load to Sandbox",
"ok": "Ok"
}
}

View File

@ -0,0 +1,125 @@
{
"fb-schema-alignment": {
"close-confirm": "There are unsaved changes. Close anyway?",
"status-warning": "There are unsaved changes.",
"assert-link-found": "Assert link when 'true' is found in column",
"search-pick-property": "Search for a property or pick one below",
"search-property": "Search for a property",
"cell": "cell",
"cells": "cells",
"which-column": "Which column?",
"configure": "Configure...",
"which-topic": "Which topic?",
"what-value": "What value?",
"anonymous": "anonymous",
"add-property": "add property",
"anonymous-node": "Anonymous Node",
"freebase-topic": "Freebase Topic",
"value": "Value",
"skeleton-node": "Schema Alignment Skeleton Node",
"text": "text",
"int": "int",
"float": "float",
"double": "double",
"boolean": "boolean",
"date-time": "date/time",
"rawstring": "rawstring",
"set-to-cell": "Set to Cell in Column",
"cell-content-used": "The cell's content is used ...",
"specify-fb-topic": "to specify a Freebase topic, as reconciled",
"type-new-topics": "Type new topics as",
"literal-value": "as a literal value",
"literal-type": "Literal type",
"text-language": "Text language",
"key-namespace": "as a key in a namespace",
"namespace": "Namespace",
"generate-anonymous": "Generate an anonymous graph node",
"assign-type": "Assign a type to the node",
"use-existing-topic": "Use one existing Freebase topic",
"value-type": "Value type",
"language": "Language",
"use-literal-value": "Use a literal value",
"column-warning": "You must select at least one column",
"new-node-warning": "For creating a new graph node, you need to specify a type for it.",
"namespace-warning": "Please specify the namespace.",
"anonymous-node-warning": "For generating an anonymous graph node, you need to specify a type for it.",
"specify-topic-warning": "Please specify which existing Freebase topic to use",
"specify-value-warning": "Please specify the value to use"
},
"fb-interface": {
"dialog-header": "Align to Freebase's Schemas",
"body-text": "The schema alignment skeleton below specifies how your grid-shaped data will be transformed into graph-shaped data in Freebase's schemas.",
"find-more": "Find out more ...",
"skeleton": "Skeleton",
"mql-preview": "MQL-like Preview",
"tripleloader-preview": "TripleLoader Preview"
},
"fb-dialogs": {
"sign-in": "Sign into Freebase",
"enable-loading": "to enable loading",
"error-new-topic": "Error creating new topic",
"error-loading-data": "Error loading data",
"add-info-source": "Click here to add a new information source",
"dialog-header": "Load Data into Freebase",
"no-triples-dataset": "This dataset has no triples",
"warning-aligned": "Have you aligned it with Freebase's schemas yet?",
"name-of-data": "Name of data load",
"source-id": "Source ID (optional)",
"bodytext-1": "Note: Your data will only be loaded into",
"bodytext-2": "Sandbox is where everyone can experiment with Freebase technologies without disruption to the official",
"bodytext-3": "Sandbox gets",
"sandbox-link": " Sandbox",
"freebase-link": " Freebase",
"refreshed-link": " refreshed periodically",
"bodytext-4": "In order to load your data into the official Freebase, you must first load it into Sandbox. Then it must pass a Quality Assurance (QA) process before it can be loaded into Freebase proper.",
"quality-assurance": "Quality assurance",
"bodytext-5": "After loaded into Sandbox, enlist other people's help to double-check this data load's quality so that it can be loaded into Freebase.",
"triple-schedule": "triples successfully scheduled for loading",
"follow-progress": "Follow the loading progress in the ",
"refinery-link": "Freebase Refinery",
"signed-as": "Signed in as:",
"sign-out": "Sign Out"
},
"fb-qa": {
"header": "QA Data Load?",
"bodytext-1": "Other people will be enlisted to help double-check your data load for quality assurance purposes. Their time and labor have a cost.",
"bodytext-2": "You yourself should have taken all reasonable measures to eliminate errors from your data load. Your prudence is greatly appreciated.",
"tell-more": "Tell me more ...",
"ok-button": "Yes, QA Data Load"
},
"fb-extend": {
"add-column": "Add Columns from Freebase Based on Column",
"warning-add-properties": "Please add some properties first.",
"querying-freebase": "Querying Freebase ...",
"remove-column": "Remove this column",
"add-constraints": "Add constraints to this column",
"mql-constraints": "Enter MQL query constraints as JSON",
"warning-valid-json": "Please ensure that the JSON you enter is valid.",
"warning-json-obj": "The JSON you enter must be an object, that is, it is of this form { ... }.",
"add-property": "Add Property",
"suggested-properties": "Suggested Properties",
"constraint": "Constraint"
},
"fb-menu": {
"freebase": "Freebase",
"set-api-key": "Set Freebase API Key",
"align-schema": "Align to Freebase's schemas...",
"load": "Load into Freebase...",
"browse-data-load": "Browse data load details...",
"import-qa": "Import QA data",
"add-columns": "Add columns from Freebase ...",
"warning-load": "You have not tried to load the data in this project into Freebase yet."
},
"fb-buttons": {
"save": "Save",
"save-load": "Save & Load",
"close": "Close",
"reset": "Reset",
"cancel": "Cancel",
"align-now": "Align Now",
"settings": "Settings",
"preview": "Preview",
"load-sandbox": "Load to Sandbox",
"ok": "Ok"
}
}

View File

@ -0,0 +1,125 @@
{
"fb-schema-alignment": {
"close-confirm": "Ci sono cambiamenti non salvati. Chiudere comunque?",
"status-warning": "Ci sono cambiamenti non salvati.",
"assert-link-found": "Assert link when 'true' is found in column",
"search-pick-property": "Cerca una proprietà o scegline una dalle seguenti",
"search-property": "Cerca una proprietà",
"cell": "cella",
"cells": "celle",
"which-column": "Quale colonna?",
"configure": "Configura...",
"which-topic": "Quale topic?",
"what-value": "Quale valore?",
"anonymous": "anonimo",
"add-property": "aggiungi proprietà",
"anonymous-node": "Nodo Anonimo",
"freebase-topic": "Topic Freebase",
"value": "Valore",
"skeleton-node": "Schema Alignment Skeleton Node",
"text": "testo",
"int": "int",
"float": "float",
"double": "double",
"boolean": "boolean",
"date-time": "data/ora",
"rawstring": "rawstring",
"set-to-cell": "Set to Cell in Column",
"cell-content-used": "Il contenuto della cella è usato ...",
"specify-fb-topic": "per specificare un topic Freebase, come riconciliato",
"type-new-topics": "Inserisci il nuovo topic come",
"literal-value": "come un valore letterale",
"literal-type": "Tipo letterale",
"text-language": "Lingua di testo",
"key-namespace": "come una chiave nel namespace",
"namespace": "Namespace",
"generate-anonymous": "Genera un nodo anonimo nel grafo",
"assign-type": "Assegna un tipo al nodo",
"use-existing-topic": "Usa un topic Freebase esistente",
"value-type": "Tipo valore",
"language": "Lingua",
"use-literal-value": "Usa un valore letterale",
"column-warning": "Devi selezionare almeno una colonna",
"new-node-warning": "Per creare un nuovo nodo nel grafo, devi specificarne un tipo.",
"namespace-warning": "Specifica il namespace.",
"anonymous-node-warning": "Per generare un nodo anonimo nel grafo, devi specificarne un tipo.",
"specify-topic-warning": "Per favore specifica quale topic esistente di Freebase usare",
"specify-value-warning": "Per favore specifica il valore da usare"
},
"fb-interface": {
"dialog-header": "Allinea con gli schemi Freebase",
"body-text": "Lo scheletro per l'allineamento della schema specifica come i tuoi dati in formato tabellare saranno trasformati in un formato a grafo con lo schema di Freebase.",
"find-more": "Per saperne di più ...",
"skeleton": "Scheletro",
"mql-preview": "Anteprima MQL-like",
"tripleloader-preview": "Anteprima TripleLoader"
},
"fb-dialogs": {
"sign-in": "Accedi a Freebase",
"enable-loading": "per abilitare il caricamento",
"error-new-topic": "Errore nella creazione di un nuovo topic",
"error-loading-data": "Errore durante il caricamento dei dati",
"add-info-source": "Clicca qui per aggiungere una nuova sorgente di informazioni",
"dialog-header": "Carica i dati in Freebase",
"no-triples-dataset": "Questo dataset non ha triple",
"warning-aligned": "Hai già effettuato l'allineamento con lo schema Freebase?",
"name-of-data": "Nome del caricamento dati",
"source-id": "ID sorgente (opzionale)",
"bodytext-1": "Nota: i tuoi dati saranno caricati solamente in",
"bodytext-2": "Sandbox è dove chiunque può sperimentare le tecnologie Freebase senza creare danni all'ufficiale",
"bodytext-3": "Sandbox viene",
"sandbox-link": " Sandbox",
"freebase-link": " Freebase",
"refreshed-link": " aggiornata periodicamente",
"bodytext-4": "Per caricare i tuoi data su Freebase ufficiale, devi prima caricarli nel Sandbox. Successivamente, devono passare un processo di analisi qualitativa prima di essere caricati su Freebase.",
"quality-assurance": "Analisi qualitativa",
"bodytext-5": "Dopo essere caricati nella Sandbox, viene chiesto l'aiuto di altre persone per controllare due volte la qualità di questi dati in modo da poter poi essere caricati in Freebase.",
"triple-schedule": "triple pianificate con successo per il caricamento",
"follow-progress": "Segui il processo di caricamento nel ",
"refinery-link": "Freebase Refinery",
"signed-as": "Accesso effettuato come:",
"sign-out": "Esci"
},
"fb-qa": {
"header": "Caricamento dati con analisi qualitativa?",
"bodytext-1": "Alcune persone verranno incaricate per controllare i tuoi dati allo scopo di verificarne la qualità. Il loro tempo e lavoro ha un costo.",
"bodytext-2": "Tu stesso dovresti aver già effettuato la maggior parte dei controlli per assicurarti di aver rimosso errori dai dati. La tua prudenza è enormemente apprezzata.",
"tell-more": "Dimmi di più ...",
"ok-button": "Si, Caricamento dati con analisi qualitativa"
},
"fb-extend": {
"add-column": "Aggiungi colonne da Freebase basandoti sulla colonna",
"warning-add-properties": "Prima aggiungi delle proprietà.",
"querying-freebase": "Interrogando Freebase ...",
"remove-column": "Rimuovi questa colonna",
"add-constraints": "Aggiungi vincoli a questa colonna",
"mql-constraints": "Inserisci i vincoli per la query MQL come JSON",
"warning-valid-json": "Assicurati che l'oggetto JSON inserito sia valido.",
"warning-json-obj": "Il JSON che inserisci deve essere un oggetto, cioè in questa forma: { ... }.",
"add-property": "Aggiungi Proprietà",
"suggested-properties": "Proprietà suggerite",
"constraint": "Vincoli"
},
"fb-menu": {
"freebase": "Freebase",
"set-api-key": "Imposta l'API Key Freebase",
"align-schema": "Allinea con lo schema Freebase...",
"load": "Carica in Freebase...",
"browse-data-load": "Vedi i dettagli per il caricamento dati...",
"import-qa": "Importa dati con controllo qualità",
"add-columns": "Aggiungi colonne da Freebase ...",
"warning-load": "Non hai ancora provato a caricare i dati di questo progetto in Freebase."
},
"fb-buttons": {
"save": "Salva",
"save-load": "Salva & Carica",
"close": "Chiudi",
"reset": "Reset",
"cancel": "Cancella",
"align-now": "Allinea adesso",
"settings": "Settings",
"preview": "Anteprima",
"load-sandbox": "Carica nella Sandbox",
"ok": "Ok"
}
}

View File

@ -1,17 +1,12 @@
<div class="dialog-frame" style="width: 400px;"> <div class="dialog-frame" style="width: 400px;">
<div class="dialog-header" bind="dialogHeader">QA Data Load?</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<p class="body-text">Other people will be enlisted to help double-check <p class="body-text" bind="bodytext1"></p>
your data load for quality assurance purposes. Their time and labor <p class="body-text" bind="bodytext2"></p>
have a cost. <p><a href="http://wiki.freebase.com/wiki/Refinery" target="_blank" bind="tellMore"></a></p>
</p>
<p class="body-text">You yourself should have taken all reasonable measures
to eliminate errors from your data load. Your prudence is greatly appreciated.
</p>
<p><a href="http://wiki.freebase.com/wiki/Refinery" target="_blank">Tell me more ...</a></p>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="okButton">Yes, QA Data Load</button> <button class="button" bind="okButton"></button>
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</div> </div>
</div> </div>

View File

@ -3,16 +3,16 @@
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div class="grid-layout layout-normal layout-full"><table rows="4"> <div class="grid-layout layout-normal layout-full"><table rows="4">
<tr> <tr>
<td width="300" height="1">Add Property</td> <td width="300" height="1" ><span bind="fb_add_property"></span></td>
<td height="1">Preview</td> <td height="1">Preview</td>
<td height="1" width="1%"><button class="button" bind="resetButton">Reset</button></td> <td height="1" width="1%"><button class="button" bind="resetButton"></button></td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: top;" height="1"><div class="input-container"><input bind="addPropertyInput" /></div></td> <td style="vertical-align: top;" height="1"><div class="input-container"><input bind="addPropertyInput" /></div></td>
<td style="vertical-align: top;" rowspan="3" colspan="2"><div class="preview-container" bind="previewContainer"></div></td> <td style="vertical-align: top;" rowspan="3" colspan="2"><div class="preview-container" bind="previewContainer"></div></td>
</tr> </tr>
<tr> <tr>
<td height="1">Suggested Properties</td> <td height="1" bind="suggested_properties"></td>
</tr> </tr>
<tr> <tr>
<td><div class="suggested-property-container" bind="suggestedPropertyContainer"></div></td> <td><div class="suggested-property-container" bind="suggestedPropertyContainer"></div></td>
@ -20,7 +20,7 @@
</table></div> </table></div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="okButton">&nbsp;&nbsp;OK&nbsp;&nbsp;</button> <button class="button" bind="okButton"></button>
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</div> </div>
</div> </div>

View File

@ -41,7 +41,15 @@ function ExtendDataPreviewDialog(column, columnIndex, rowIndices, onDone) {
var self = this; var self = this;
this._dialog = $(DOM.loadHTML("freebase", "scripts/dialogs/extend-data-preview-dialog.html")); this._dialog = $(DOM.loadHTML("freebase", "scripts/dialogs/extend-data-preview-dialog.html"));
this._elmts = DOM.bind(this._dialog); this._elmts = DOM.bind(this._dialog);
this._elmts.dialogHeader.text("Add Columns from Freebase Based on Column " + column.name);
this._elmts.dialogHeader.text($.i18n._('fb-extend')["add-column"]);
this._elmts.fb_add_property.html($.i18n._('fb-extend')["add-property"]);
this._elmts.suggested_properties.text($.i18n._('fb-extend')["suggested-properties"]);
this._elmts.resetButton.text($.i18n._('fb-buttons')["reset"]);
this._elmts.okButton.html('&nbsp;&nbsp;'+$.i18n._('fb-buttons')["ok"]+'&nbsp;&nbsp;');
this._elmts.cancelButton.text($.i18n._('fb-buttons')["cancel"]);
this._elmts.resetButton.click(function() { this._elmts.resetButton.click(function() {
self._extension.properties = []; self._extension.properties = [];
self._update(); self._update();
@ -49,7 +57,7 @@ function ExtendDataPreviewDialog(column, columnIndex, rowIndices, onDone) {
this._elmts.okButton.click(function() { this._elmts.okButton.click(function() {
if (self._extension.properties.length === 0) { if (self._extension.properties.length === 0) {
alert("Please add some properties first."); alert($.i18n._('fb-extend')["warning-add-properties"]);
} else { } else {
DialogSystem.dismissUntil(self._level - 1); DialogSystem.dismissUntil(self._level - 1);
self._onDone(self._extension); self._onDone(self._extension);
@ -157,7 +165,7 @@ ExtendDataPreviewDialog.prototype._show = function(properties) {
}; };
ExtendDataPreviewDialog.prototype._update = function() { ExtendDataPreviewDialog.prototype._update = function() {
this._elmts.previewContainer.empty().text("Querying Freebase ..."); this._elmts.previewContainer.empty().text($.i18n._('fb-extend')["querying-freebase"]);
var self = this; var self = this;
var params = { var params = {
@ -234,7 +242,7 @@ ExtendDataPreviewDialog.prototype._renderPreview = function(data) {
$('<a href="javascript:{}"></a>') $('<a href="javascript:{}"></a>')
.text("remove") .text("remove")
.addClass("action") .addClass("action")
.attr("title", "Remove this column") .attr("title", $.i18n._('fb-extend')["remove-column"])
.click(function() { .click(function() {
self._removeProperty(column.path); self._removeProperty(column.path);
}).appendTo(th); }).appendTo(th);
@ -242,7 +250,7 @@ ExtendDataPreviewDialog.prototype._renderPreview = function(data) {
$('<a href="javascript:{}"></a>') $('<a href="javascript:{}"></a>')
.text("constrain") .text("constrain")
.addClass("action") .addClass("action")
.attr("title", "Add constraints to this column") .attr("title", $.i18n._('fb-extend')["add-constraints"])
.click(function() { .click(function() {
self._constrainProperty(column.path); self._constrainProperty(column.path);
}).appendTo(th); }).appendTo(th);
@ -329,14 +337,14 @@ ExtendDataPreviewDialog.prototype._constrainProperty = function(path) {
var frame = DialogSystem.createDialog(); var frame = DialogSystem.createDialog();
frame.width("500px"); frame.width("500px");
var header = $('<div></div>').addClass("dialog-header").text("Constrain " + path.join(" > ")).appendTo(frame); var header = $('<div></div>').addClass("dialog-header").text(" " + path.join(" > ")).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( body.html(
'<div class="grid-layout layout-normal layout-full"><table>' + '<div class="grid-layout layout-normal layout-full"><table>' +
'<tr><td>' + '<tr><td>' +
'Enter MQL query constraints as JSON' + $.i18n._('fb-extend')["mql-constraints"] +
'</td></tr>' + '</td></tr>' +
'<tr><td>' + '<tr><td>' +
'<textarea style="width: 100%; height: 300px; font-family: monospace;" bind="textarea"></textarea>' + '<textarea style="width: 100%; height: 300px; font-family: monospace;" bind="textarea"></textarea>' +
@ -352,8 +360,8 @@ ExtendDataPreviewDialog.prototype._constrainProperty = function(path) {
} }
footer.html( footer.html(
'<button class="button" bind="okButton">&nbsp;&nbsp;OK&nbsp;&nbsp;</button>' + '<button class="button" bind="okButton">&nbsp;&nbsp;'+$.i18n._('fb-buttons')["ok"]+'&nbsp;&nbsp;</button>' +
'<button class="button" bind="cancelButton">Cancel</button>' '<button class="button" bind="cancelButton">'+$.i18n._('fb-buttons')["cancel"]+'</button>'
); );
var footerElmts = DOM.bind(footer); var footerElmts = DOM.bind(footer);
@ -367,7 +375,7 @@ ExtendDataPreviewDialog.prototype._constrainProperty = function(path) {
try { try {
var o = JSON.parse(bodyElmts.textarea[0].value); var o = JSON.parse(bodyElmts.textarea[0].value);
if (o === undefined) { if (o === undefined) {
alert("Please ensure that the JSON you enter is valid."); alert($.i18n._('fb-extend')["warning-valid-json"]);
return; return;
} }
@ -375,7 +383,7 @@ ExtendDataPreviewDialog.prototype._constrainProperty = function(path) {
o = o[0]; o = o[0];
} }
if (!$.isPlainObject(o)) { if (!$.isPlainObject(o)) {
alert("The JSON you enter must be an object, that is, it is of this form { ... }."); alert($.i18n._('fb-extend')["warning-json-obj"]);
return; return;
} }

View File

@ -1,44 +1,40 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-header" bind="dialogHeader">Load Data into Freebase</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div bind="unalignedCase" style="display: none;" class="freebase-loading-tripleloader-message"> <div bind="unalignedCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2>This dataset has no triples</h2> <h2 bind="no_triples_dataset"></h2>
<p>Have you aligned it with Freebase's schemas yet? <button class="button" bind="alignButton">Align Now</button></p> <p bind="warning_aligned"><button class="button" bind="alignButton"></button></p>
</div> </div>
<div bind="functionalCase" style="display: none;"> <div bind="functionalCase" style="display: none;">
<div class="refine-tabs" bind="functionalTabs"> <div class="refine-tabs" bind="functionalTabs">
<ul> <ul>
<li><a href="#freebase-loading-dialog-functional-tabs-settings">Settings</a></li> <li><a href="#freebase-loading-dialog-functional-tabs-settings" bind="settingsBtn"></a></li>
<li><a href="#freebase-loading-dialog-functional-tabs-preview">Preview</a></li> <li><a href="#freebase-loading-dialog-functional-tabs-preview" bind="previewBtn"></a></li>
</ul> </ul>
<div id="freebase-loading-dialog-functional-tabs-settings" <div id="freebase-loading-dialog-functional-tabs-settings"
class="freebase-loading-dialog-functional-tab-panel"><div class="grid-layout layout-normal"><table> class="freebase-loading-dialog-functional-tab-panel"><div class="grid-layout layout-normal"><table>
<tr><td width="20%">Name of data load</td> <tr><td width="20%" bind="name_of_data"></td>
<td colspan="2"><input type="text" size="40" id="freebase-loading-source-name" bind="source_name" /></td> <td colspan="2"><input type="text" size="40" id="freebase-loading-source-name" bind="source_name" /></td>
</tr> </tr>
<tr><td>Source ID (optional)</td> <tr><td bind="source_id_label"></td>
<td colspan="2"><input type="text" size="60" id="freebase-loading-source-id" bind="source_id" /></td> <td colspan="2"><input type="text" size="60" id="freebase-loading-source-id" bind="source_id" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<p class="body-text">Note: Your data will only be loaded into <p class="body-text"><span bind="bodytext1"></span>
<a href="http://www.sandbox-freebase.com/" target="_blank">Sandbox</a>. <a href="http://www.sandbox-freebase.com/" target="_blank" bind="sandbox_link"></a>.
Sandbox is where everyone can experiment with Freebase technologies without disruption <span bind="bodytext2"> </span><a href="http://www.freebase.com/" bind="freebase_link"></a>.
to the official <a href="http://www.freebase.com/">Freebase</a>. Sandbox gets <span bind="bodytext3"></span><a href="http://wiki.freebase.com/wiki/Sandbox"
<a href="http://wiki.freebase.com/wiki/Sandbox" target="_blank">refreshed periodically</a>. target="_blank" bind="refreshed_link"></a>.
</p> </p>
<p class="body-text">In order to load your data into the official Freebase, you must first load it <p class="body-text" bind="bodytext4">
into Sandbox. Then it must pass a Quality Assurance (QA) process before it can <a href="http://wiki.freebase.com/wiki/Refinery" target="_blank" bind="findOutMore"></a>
be loaded into Freebase proper.
<a href="http://wiki.freebase.com/wiki/Refinery" target="_blank">Find out more ...</a>
</p> </p>
</td> </td>
</tr> </tr>
<tr><td>Quality assurance</td> <tr><td bind="quality_assurance"></td>
<td><input bind="qaCheckbox" type="checkbox" name="qa" value="qa" /></td> <td><input bind="qaCheckbox" type="checkbox" name="qa" value="qa" /></td>
<td>After loaded into Sandbox, enlist other people's help to double-check <td bind="bodytext5"></td>
this data load's quality so that it can be loaded into Freebase.
</td>
</tr> </tr>
</table></div></div> </table></div></div>
<div id="freebase-loading-dialog-functional-tabs-preview" <div id="freebase-loading-dialog-functional-tabs-preview"
@ -49,8 +45,8 @@
</div> </div>
</div> </div>
<div bind="loadedCase" style="display: none;" class="freebase-loading-tripleloader-message"> <div bind="loadedCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2><span bind="tripleCountSpan"></span> triples successfully scheduled for loading</h2> <h2><span bind="tripleCountSpan"></span> <span bind="triple_success_load"></span></h2>
<h4>Follow the loading progress in the <a bind="refineryLink" target="_new">Freebase Refinery</a>.</h4> <h4><span bind="follow_progress"></span> <a bind="refineryLink" target="_new"></a>.</h4>
</div> </div>
<div bind="errorCase" style="display: none;" class="freebase-loading-tripleloader-message"> <div bind="errorCase" style="display: none;" class="freebase-loading-tripleloader-message">
<h2 bind="errorMessage"></h2> <h2 bind="errorMessage"></h2>
@ -59,13 +55,13 @@
</div> </div>
<div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr> <div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr>
<td bind="left" style="text-align: left" width="60%" nowrap="true"> <td bind="left" style="text-align: left" width="60%" nowrap="true">
<button class="button" bind="cancelButton" id="freebase-loading-cancel">Cancel</button> <button class="button" bind="cancelButton" id="freebase-loading-cancel"></button>
</td> </td>
<td bind="center" style="text-align: right" width="20%" nowrap="true"> <td bind="center" style="text-align: right" width="20%" nowrap="true">
<div bind="authorization" class="freebase-loading-authorization"></div> <div bind="authorization" class="freebase-loading-authorization"></div>
</td> </td>
<td bind="right" style="text-align: right" width="20%" nowrap="true"> <td bind="right" style="text-align: right" width="20%" nowrap="true">
<button class="button button-primary button-disabled" bind="loadButton" id="freebase-loading-load" disabled>Load to Sandbox</button> <button class="button button-primary button-disabled" bind="loadButton" id="freebase-loading-load" disabled></button>
</td> </td>
</tr></table></div></div> </tr></table></div></div>
</div> </div>

View File

@ -46,12 +46,36 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
var authorization = this._elmts.authorization; var authorization = this._elmts.authorization;
var loadButton = this._elmts.loadButton; var loadButton = this._elmts.loadButton;
this._elmts.dialogHeader.text($.i18n._('fb-dialogs')["dialog-header"]);
this._elmts.no_triples_dataset.text($.i18n._('fb-dialogs')["no-triples-dataset"]);
this._elmts.warning_aligned.text($.i18n._('fb-dialogs')["warning-aligned"]);
this._elmts.alignButton.text($.i18n._('fb-buttons')["align-now"]);
this._elmts.settingsBtn.text($.i18n._('fb-buttons')["settings"]);
this._elmts.previewBtn.text($.i18n._('fb-buttons')["preview"]);
this._elmts.name_of_data.text($.i18n._('fb-dialogs')["name-of-data"]);
this._elmts.source_id_label.text($.i18n._('fb-dialogs')["source-id"]);
this._elmts.bodytext1.text($.i18n._('fb-dialogs')["bodytext-1"]);
this._elmts.bodytext2.text($.i18n._('fb-dialogs')["bodytext-2"]);
this._elmts.bodytext3.text($.i18n._('fb-dialogs')["bodytext-3"]);
this._elmts.sandbox_link.text($.i18n._('fb-dialogs')["sandbox-link"]);
this._elmts.freebase_link.text($.i18n._('fb-dialogs')["freebase-link"]);
this._elmts.refreshed_link.text($.i18n._('fb-dialogs')["refreshed-link"]);
this._elmts.bodytext4.text($.i18n._('fb-dialogs')["bodytext-4"]);
this._elmts.findOutMore.text($.i18n._('fb-interface')["find-more"]);
this._elmts.quality_assurance.text($.i18n._('fb-dialogs')["quality-assurance"]);
this._elmts.bodytext5.text($.i18n._('fb-dialogs')["bodytext-5"]);
this._elmts.triple_success_load.text($.i18n._('fb-dialogs')["triple-schedule"]);
this._elmts.follow_progress.text($.i18n._('fb-dialogs')["follow-progress"]);
this._elmts.refineryLink.text($.i18n._('fb-dialogs')["refinery-link"]);
this._elmts.cancelButton.text($.i18n._('fb-buttons')["cancel"]);
this._elmts.loadButton.text($.i18n._('fb-buttons')["load-sandbox"]);
// TODO: Does this need to be redone for the new API / freebase.com site? // TODO: Does this need to be redone for the new API / freebase.com site?
var check_authorization = function(cont) { var check_authorization = function(cont) {
var check_authorization_url = "command/freebase/check-authorization/" + provider; var check_authorization_url = "command/freebase/check-authorization/" + provider;
$.get(check_authorization_url, function(data) { $.get(check_authorization_url, function(data) {
if ("status" in data && data.code == "/api/status/ok") { if ("status" in data && data.code == "/api/status/ok") {
authorization.html('Signed in as: <a target="_new" href="http://www.freebase.com/view/user/' + data.username + '">' + data.username + '</a> | <a href="javascript:{}" bind="signout">Sign Out</a>').show(); authorization.html($.i18n._('fb-dialogs')["signed-as"]+' <a target="_new" href="http://www.freebase.com/view/user/' + data.username + '">' + data.username + '</a> | <a href="javascript:{}" bind="signout">'+$.i18n._('fb-dialogs')["sign-out"]+'</a>').show();
DOM.bind(authorization).signout.click(function() { DOM.bind(authorization).signout.click(function() {
self._signedin = false; self._signedin = false;
loadButton.attr("disabled","disabled"); loadButton.attr("disabled","disabled");
@ -71,7 +95,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
if (typeof cont == "function") cont(data); if (typeof cont == "function") cont(data);
} else { } else {
authorization.html('<a href="javascript:{}" bind="signin">Sign into Freebase</a> to enable loading').show(); authorization.html('<a href="javascript:{}" bind="signin">'+$.i18n._('fb-dialogs')["sign-in"]+'</a> '+$.i18n._('fb-dialogs')["enable-loading"]).show();
self._signedin = false; self._signedin = false;
$("#freebase-loading-source-name").keyup(); $("#freebase-loading-source-name").keyup();
@ -104,7 +128,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
self._elmts.source_id.val(data.result[0].id); self._elmts.source_id.val(data.result[0].id);
if (typeof cont == "function") cont(); if (typeof cont == "function") cont();
} else { } else {
self._show_error("Error creating new topic", data); self._show_error($.i18n._('fb-dialogs')["error-new-topic"], data);
} }
}, },
"json" "json"
@ -137,7 +161,7 @@ FreebaseLoadingDialog.prototype._createDialog = function() {
self._elmts.source_id.suggest({ self._elmts.source_id.suggest({
filter: "(all type:/dataworld/information_source)", filter: "(all type:/dataworld/information_source)",
suggest_new: "Click here to add a new information source" suggest_new: $.i18n._('fb-dialogs')["add-info-source"]
}).bind("fb-select", function(e, data) { }).bind("fb-select", function(e, data) {
self._elmts.source_id.val(data.id); self._elmts.source_id.val(data.id);
}).bind("fb-select-new", function(e, val) { }).bind("fb-select-new", function(e, val) {
@ -202,7 +226,7 @@ FreebaseLoadingDialog.prototype._load = function() {
self._elmts.loadedCase.show(); self._elmts.loadedCase.show();
self._end(); self._end();
} else { } else {
self._show_error("Error loading data",data); self._show_error($.i18n._('fb-dialogs')["error-loading-data"],data);
} }
}, },
"json" "json"
@ -217,6 +241,13 @@ FreebaseLoadingDialog.prototype._load = function() {
DialogSystem.dismissUntil(level - 1); DialogSystem.dismissUntil(level - 1);
}; };
this._elmts.refineryLink.text($.i18n._('fb-qa')["header"]);
this._elmts.bodytext1.text($.i18n._('fb-qa')["bodytext-1"]);
this._elmts.bodytext2.text($.i18n._('fb-qa')["bodytext-2"]);
this._elmts.tellMore.text($.i18n._('fb-qa')["tell-more"]);
this._elmts.okButton.text($.i18n._('fb-qa')["ok-button"]);
this._elmts.cancelButton.text($.i18n._('fb-qa')["ok-button"]);
elmts.okButton.click(function() { elmts.okButton.click(function() {
doLoad(); doLoad();
dismiss(); dismiss();

View File

@ -234,6 +234,17 @@ SchemaAlignmentDialog.prototype._createDialog = function() {
DialogSystem.dismissUntil(self._level - 1); DialogSystem.dismissUntil(self._level - 1);
}; };
elmts.dialogHeader.text($.i18n._('fb-interface')["dialog-header"]);
elmts.body_text.text($.i18n._('fb-interface')["body-text"]);
elmts.find_more.text($.i18n._('fb-interface')["find-more"]);
elmts.skeleton.text($.i18n._('fb-interface')["skeleton"]);
elmts.skeleton.text($.i18n._('fb-interface')["mql-preview"]);
elmts.skeleton.text($.i18n._('fb-interface')["tripleloader-preview"]);
elmts.saveButton.text($.i18n._('fb-buttons')["save"]);
elmts.saveAndLoadButton.text($.i18n._('fb-buttons')["save-load"]);
elmts.closeButton.text($.i18n._('fb-buttons')["close"]);
elmts.resetButton.text($.i18n._('fb-buttons')["reset"]);
elmts.saveButton.click(function() { elmts.saveButton.click(function() {
self._save(); self._save();
}); });
@ -247,7 +258,7 @@ SchemaAlignmentDialog.prototype._createDialog = function() {
self._reset(null); self._reset(null);
}); });
elmts.closeButton.click(function() { elmts.closeButton.click(function() {
if (!self._hasUnsavedChanges || window.confirm("There are unsaved changes. Close anyway?")) { if (!self._hasUnsavedChanges || window.confirm($.i18n._('fb-schema-alignment')["close-confirm"])) {
dismiss(); dismiss();
} }
}); });
@ -281,7 +292,7 @@ SchemaAlignmentDialog.prototype.preview = function(initial) {
this._previewPanes.empty(); this._previewPanes.empty();
if (!(initial)) { if (!(initial)) {
this._elmts.statusIndicator.show().text("There are unsaved changes."); this._elmts.statusIndicator.show().text($.i18n._('fb-schema-alignment')["status-warning"]);
this._hasUnsavedChanges = true; this._hasUnsavedChanges = true;
} }

View File

@ -1,16 +1,14 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-header" bind="dialogHeader">Align to Freebase's Schemas</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<p class="body-text"> <p class="body-text" bind="body_text">
The schema alignment skeleton below specifies how your grid-shaped data will be <a href="http://github.com/OpenRefine/OpenRefine/wiki/SchemaAlignment" target="_blank" bind="find_more"></a>
transformed into graph-shaped data in Freebase's schemas.
<a href="http://github.com/OpenRefine/OpenRefine/wiki/SchemaAlignment" target="_blank">Find out more ...</a>
</p> </p>
<div id="schema-alignment-tabs" class="refine-tabs"> <div id="schema-alignment-tabs" class="refine-tabs">
<ul> <ul>
<li><a href="#schema-alignment-tabs-protograph">Skeleton</a></li> <li><a href="#schema-alignment-tabs-protograph" bind="skeleton"></a></li>
<li><a href="#schema-alignment-tabs-preview-mqllike">MQL-like Preview</a></li> <li><a href="#schema-alignment-tabs-preview-mqllike" bind="mql_preview"></a></li>
<li><a href="#schema-alignment-tabs-preview-tripleloader">TripleLoader Preview</a></li> <li><a href="#schema-alignment-tabs-preview-tripleloader" bind="tripleloader_preview"></a></li>
</ul> </ul>
<div id="schema-alignment-tabs-protograph"> <div id="schema-alignment-tabs-protograph">
<div class="schema-alignment-dialog-canvas"></div> <div class="schema-alignment-dialog-canvas"></div>
@ -25,17 +23,17 @@
</div> </div>
<div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr> <div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr>
<td> <td>
<button class="button" bind="resetButton">Reset</button> <button class="button" bind="resetButton"></button>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<button class="button button-primary" bind="saveButton">Save</button> <button class="button button-primary" bind="saveButton"></button>
<button class="button" bind="saveAndLoadButton">Save &amp; Load</button> <button class="button" bind="saveAndLoadButton"></button>
</td> </td>
<td style="text-align:center;" width="30%"> <td style="text-align:center;" width="30%">
<span class="schema-alignment-status-indicator" bind="statusIndicator"></span> <span class="schema-alignment-status-indicator" bind="statusIndicator"></span>
</td> </td>
<td style="text-align:right;" width="1%"> <td style="text-align:right;" width="1%">
<button class="button" bind="closeButton">Close</button> <button class="button" bind="closeButton"></button>
</td> </td>
</tr></table></div></div> </tr></table></div></div>
</div> </div>

View File

@ -239,7 +239,7 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
var divConditional = $('<div>') var divConditional = $('<div>')
.addClass("schema-alignment-link-menu-section") .addClass("schema-alignment-link-menu-section")
.html("Assert link when 'true' is found in column<br/>").appendTo(menu); .html($.i18n._('fb-schema-alignment')["assert-link-found"]+"<br/>").appendTo(menu);
var conditionalSelect = $('<select>').appendTo(divConditional); var conditionalSelect = $('<select>').appendTo(divConditional);
$('<option>') $('<option>')
@ -266,7 +266,7 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
divSearch = $('<div>') divSearch = $('<div>')
.addClass("schema-alignment-link-menu-section") .addClass("schema-alignment-link-menu-section")
.css("margin-bottom", "2em") .css("margin-bottom", "2em")
.html('<div>Search for a property or pick one below</div>').appendTo(menu); .html('<div>'+$.i18n._('fb-schema-alignment')["search-pick-property"]+'</div>').appendTo(menu);
var createSuggestion = function(suggestion) { var createSuggestion = function(suggestion) {
var menuItem = MenuSystem.createMenuItem().appendTo(menu); var menuItem = MenuSystem.createMenuItem().appendTo(menu);
@ -296,7 +296,7 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
} else { } else {
divSearch = $('<div>') divSearch = $('<div>')
.addClass("schema-alignment-link-menu-section-last") .addClass("schema-alignment-link-menu-section-last")
.html('<div>Search for a property</div>').appendTo(menu); .html('<div>'+$.i18n._('fb-schema-alignment')["search-property"]+'</div>').appendTo(menu);
} }
var input = $('<input />').appendTo($('<div>').appendTo(divSearch)); var input = $('<input />').appendTo($('<div>').appendTo(divSearch));

View File

@ -124,9 +124,12 @@ SchemaAlignmentDialog.UINode.prototype._renderMain = function() {
.appendTo(a); .appendTo(a);
} }
$('<span>').text(this._node.columnNames.length > 1 ? " cells" : " cell").appendTo(a); $('<span>').text(
this._node.columnNames.length > 1 ? " "
+ $.i18n._('fb-schema-alignment')["cells"] : " "
+ $.i18n._('fb-schema-alignment')["cell"]).appendTo(a);
} else { } else {
a.html(this._options.mustBeCellTopic ? "Which column?" : "Configure..."); a.html(this._options.mustBeCellTopic ? $.i18n._('fb-schema-alignment')["which-column"] : $.i18n._('fb-schema-alignment')["configure"]);
} }
} else if (this._node.nodeType == "topic") { } else if (this._node.nodeType == "topic") {
if ("topic" in this._node) { if ("topic" in this._node) {
@ -134,16 +137,16 @@ SchemaAlignmentDialog.UINode.prototype._renderMain = function() {
} else if ("id" in this._node) { } else if ("id" in this._node) {
a.html(this._node.topic.id); a.html(this._node.topic.id);
} else { } else {
a.html("Which topic?"); a.html($.i18n._('fb-schema-alignment')["which-topic"]);
} }
} else if (this._node.nodeType == "value") { } else if (this._node.nodeType == "value") {
if ("value" in this._node) { if ("value" in this._node) {
a.html(this._node.value); a.html(this._node.value);
} else { } else {
a.html("What value?"); a.html($.i18n._('fb-schema-alignment')["what-value"]);
} }
} else if (this._node.nodeType == "anonymous") { } else if (this._node.nodeType == "anonymous") {
a.html("(anonymous)"); a.html("("+$.i18n._('fb-schema-alignment')["anonymous"]+")");
} }
}; };
@ -212,7 +215,7 @@ SchemaAlignmentDialog.UINode.prototype._renderDetails = function() {
$('<a href="javascript:{}"></a>') $('<a href="javascript:{}"></a>')
.addClass("action") .addClass("action")
.text("add property") .text($.i18n._('fb-schema-alignment')["add-property"])
.appendTo(divFooter) .appendTo(divFooter)
.click(function() { .click(function() {
var newLink = { var newLink = {
@ -241,7 +244,7 @@ SchemaAlignmentDialog.UINode.prototype._showColumnPopupMenu = function(elmt) {
if (!this._options.mustBeCellTopic) { if (!this._options.mustBeCellTopic) {
menu.push({ menu.push({
label: "Anonymous Node", label: $.i18n._('fb-schema-alignment')["anonymous-node"],
click: function() { click: function() {
self._node.nodeType = "anonymous"; self._node.nodeType = "anonymous";
self._showExpandable(); self._showExpandable();
@ -249,7 +252,7 @@ SchemaAlignmentDialog.UINode.prototype._showColumnPopupMenu = function(elmt) {
} }
}); });
menu.push({ menu.push({
label: "Freebase Topic", label: $.i18n._('fb-schema-alignment')["freebase-topic"],
click: function() { click: function() {
self._node.nodeType = "topic"; self._node.nodeType = "topic";
self._hideExpandable(); self._hideExpandable();
@ -257,7 +260,7 @@ SchemaAlignmentDialog.UINode.prototype._showColumnPopupMenu = function(elmt) {
} }
}); });
menu.push({ menu.push({
label: "Value", label: $.i18n._('fb-schema-alignment')["value"],
click: function() { click: function() {
self._node.nodeType = "value"; self._node.nodeType = "value";
self._hideExpandable(); self._hideExpandable();
@ -292,7 +295,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
frame.width("750px"); frame.width("750px");
var header = $('<div></div>').addClass("dialog-header").text("Schema Alignment Skeleton Node").appendTo(frame); var header = $('<div></div>').addClass("dialog-header").text($.i18n._('fb-schema-alignment')["skeleton-node"]).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);
@ -301,13 +304,13 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
*-------------------------------------------------- *--------------------------------------------------
*/ */
var literalTypeSelectHtml = var literalTypeSelectHtml =
'<option value="/type/text" checked>text</option>' + '<option value="/type/text" checked>'+$.i18n._('fb-schema-alignment')["text"]+'</option>' +
'<option value="/type/int">int</option>' + '<option value="/type/int">'+$.i18n._('fb-schema-alignment')["int"]+'</option>' +
'<option value="/type/float">float</option>' + '<option value="/type/float">'+$.i18n._('fb-schema-alignment')["float"]+'</option>' +
'<option value="/type/double">double</option>' + '<option value="/type/double">'+$.i18n._('fb-schema-alignment')["double"]+'</option>' +
'<option value="/type/boolean">boolean</option>' + '<option value="/type/boolean">'+$.i18n._('fb-schema-alignment')["boolean"]+'</option>' +
'<option value="/type/datetime">date/time</option>' + '<option value="/type/datetime">'+$.i18n._('fb-schema-alignment')["date-time"]+'</option>' +
'<option value="/type/rawstring">rawstring</option>'; '<option value="/type/rawstring">'+$.i18n._('fb-schema-alignment')["rawstring"]+'</option>';
var html = $( var html = $(
'<div class="grid-layout layout-looser layout-full"><table>' + '<div class="grid-layout layout-looser layout-full"><table>' +
@ -317,7 +320,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<tr>' + '<tr>' +
'<td>' + '<td>' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
'<input type="radio" name="schema-align-node-dialog-node-type" value="cell-as" bind="radioNodeTypeCellAs" /> Set to Cell in Column' + '<input type="radio" name="schema-align-node-dialog-node-type" value="cell-as" bind="radioNodeTypeCellAs" /> '+$.i18n._('fb-schema-alignment')["set-to-cell"]+'' +
'</div>' + '</div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
@ -329,15 +332,15 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<td>' + '<td>' +
'<div class="grid-layout layout-tight"><table cols="4">' + '<div class="grid-layout layout-tight"><table cols="4">' +
'<tr>' + '<tr>' +
'<td colspan="4">The cell\'s content is used ...</td>' + '<td colspan="4">'+$.i18n._('fb-schema-alignment')["cell-content-used"]+'</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-topic" bind="radioNodeTypeCellAsTopic" /></td>' + '<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-topic" bind="radioNodeTypeCellAsTopic" /></td>' +
'<td colspan="3">to specify a Freebase topic, as reconciled</td>' + '<td colspan="3">'+$.i18n._('fb-schema-alignment')["specify-fb-topic"]+'</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="3">Type new topics as</td>' + '<td colspan="3">'+$.i18n._('fb-schema-alignment')["type-new-topic"]+'</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
@ -345,26 +348,26 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-value" bind="radioNodeTypeCellAsValue" /></td>' + '<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-value" bind="radioNodeTypeCellAsValue" /></td>' +
'<td colspan="3">as a literal value</td>' + '<td colspan="3">'+$.i18n._('fb-schema-alignment')["literal-value"]+'</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="2">Literal type</td>' + '<td colspan="2">'+$.i18n._('fb-schema-alignment')["literal-type"]+'</td>' +
'<td colspan="1"><select bind="cellAsValueTypeSelect">' + literalTypeSelectHtml + '</select></td>' + '<td colspan="1"><select bind="cellAsValueTypeSelect">' + literalTypeSelectHtml + '</select></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="2">Text language</td>' + '<td colspan="2">'+$.i18n._('fb-schema-alignment')["text-language"]+'</td>' +
'<td colspan="1"><input bind="cellAsValueLanguageInput" /></td>' + '<td colspan="1"><input bind="cellAsValueLanguageInput" /></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-key" bind="radioNodeTypeCellAsKey" /></td>' + '<td><input type="radio" name="schema-align-node-dialog-node-subtype" value="cell-as-key" bind="radioNodeTypeCellAsKey" /></td>' +
'<td colspan="3">as a key in a namespace</td>' + '<td colspan="3">'+$.i18n._('fb-schema-alignment')["key-namespace"]+'</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td colspan="2">Namespace</td>' + '<td colspan="2">'+$.i18n._('fb-schema-alignment')["namespace"]+'</td>' +
'<td colspan="1"><input bind="cellAsKeyInput" /></td>' + '<td colspan="1"><input bind="cellAsKeyInput" /></td>' +
'</tr>' + '</tr>' +
'</table></div>' + '</table></div>' +
@ -381,20 +384,20 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<tr>' + '<tr>' +
'<td colspan="3">' + '<td colspan="3">' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
'<input type="radio" name="schema-align-node-dialog-node-type" value="anonymous" bind="radioNodeTypeAnonymous" /> Generate an anonymous graph node' + '<input type="radio" name="schema-align-node-dialog-node-type" value="anonymous" bind="radioNodeTypeAnonymous" /> '+$.i18n._('fb-schema-alignment')["generate-anonymous"]+'' +
'</div>' + '</div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td>Assign a type to the node</td>' + '<td>'+$.i18n._('fb-schema-alignment')["assign-type"]+'</td>' +
'<td>&nbsp;<input bind="anonymousNodeTypeInput" /></td>' + '<td>&nbsp;<input bind="anonymousNodeTypeInput" /></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td colspan="3">' + '<td colspan="3">' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
'<input type="radio" name="schema-align-node-dialog-node-type" value="topic" bind="radioNodeTypeTopic" /> Use one existing Freebase topic' + '<input type="radio" name="schema-align-node-dialog-node-type" value="topic" bind="radioNodeTypeTopic" /> '+$.i18n._('fb-schema-alignment')["use-existing-topic"]+'' +
'</div>' + '</div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
@ -407,23 +410,23 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
'<tr>' + '<tr>' +
'<td colspan="3">' + '<td colspan="3">' +
'<div class="schema-align-node-dialog-node-type">' + '<div class="schema-align-node-dialog-node-type">' +
'<input type="radio" name="schema-align-node-dialog-node-type" value="value" bind="radioNodeTypeValue" /> Use a literal value' + '<input type="radio" name="schema-align-node-dialog-node-type" value="value" bind="radioNodeTypeValue" /> '+$.i18n._('fb-schema-alignment')["use-literal-value"]+
'</div>' + '</div>' +
'</td>' + '</td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td>Value</td>' + '<td>'+$.i18n._('fb-schema-alignment')["value"]+'</td>' +
'<td><input bind="valueNodeTypeValueInput" /></td>' + '<td><input bind="valueNodeTypeValueInput" /></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td>Value type</td>' + '<td>'+$.i18n._('fb-schema-alignment')["value-type"]+'</td>' +
'<td><select bind="valueNodeTypeValueTypeSelect">' + literalTypeSelectHtml + '</select></td>' + '<td><select bind="valueNodeTypeValueTypeSelect">' + literalTypeSelectHtml + '</select></td>' +
'</tr>' + '</tr>' +
'<tr>' + '<tr>' +
'<td></td>' + '<td></td>' +
'<td>Language</td>' + '<td>'+$.i18n._('fb-schema-alignment')["language"]+'</td>' +
'<td><input bind="valueNodeTypeLanguageInput" /></td>' + '<td><input bind="valueNodeTypeLanguageInput" /></td>' +
'</tr>' + '</tr>' +
'</table></div>' + '</table></div>' +
@ -581,14 +584,14 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
}).get(); }).get();
if (node.columnNames.length == 0) { if (node.columnNames.length == 0) {
alert("You must select at least one column."); alert($.i18n._('fb-schema-alignment')["column-warning"]);
return null; return null;
} }
if (node.nodeType == "cell-as-topic") { if (node.nodeType == "cell-as-topic") {
var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest"); var t = elmts.cellAsTopicNodeTypeInput.data("data.suggest");
if (!(t)) { if (!(t)) {
alert("For creating a new graph node, you need to specify a type for it."); alert($.i18n._('fb-schema-alignment')["new-node-warning"]);
elmts.cellAsTopicNodeTypeInput.focus(); elmts.cellAsTopicNodeTypeInput.focus();
return null; return null;
} }
@ -606,7 +609,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} else if (node.nodeType == "cell-as-key") { } else if (node.nodeType == "cell-as-key") {
var t = elmts.cellAsKeyInput.data("data.suggest"); var t = elmts.cellAsKeyInput.data("data.suggest");
if (!(t)) { if (!(t)) {
alert("Please specify the namespace."); alert($.i18n._('fb-schema-alignment')["namespace-warning"]);
return null; return null;
} }
node.namespace = { node.namespace = {
@ -617,7 +620,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} else if (node.nodeType == "anonymous") { } else if (node.nodeType == "anonymous") {
var t = elmts.anonymousNodeTypeInput.data("data.suggest"); var t = elmts.anonymousNodeTypeInput.data("data.suggest");
if (!(t)) { if (!(t)) {
alert("For generating an anonymous graph node, you need to specify a type for it."); alert($.i18n._('fb-schema-alignment')["anonymous-node-warning"]);
return null; return null;
} }
node.type = { node.type = {
@ -627,7 +630,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} else if (node.nodeType == "topic") { } else if (node.nodeType == "topic") {
var t = elmts.topicNodeTypeInput.data("data.suggest"); var t = elmts.topicNodeTypeInput.data("data.suggest");
if (!(t)) { if (!(t)) {
alert("Please specify which existing Freebase topic to use."); alert($.i18n._('fb-schema-alignment')["specify-topic-warning"]);
return null; return null;
} }
node.topic = { node.topic = {
@ -637,7 +640,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} else if (node.nodeType == "value") { } else if (node.nodeType == "value") {
node.value = $.trim(elmts.valueNodeTypeValueInput[0].value); node.value = $.trim(elmts.valueNodeTypeValueInput[0].value);
if (!node.value.length) { if (!node.value.length) {
alert("Please specify the value to use."); alert($.i18n._('fb-schema-alignment')["specify-value-warning"]);
return null; return null;
} }
node.valueType = elmts.valueNodeTypeValueTypeSelect[0].value; node.valueType = elmts.valueNodeTypeValueTypeSelect[0].value;
@ -662,7 +665,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
} }
}).appendTo(footer); }).appendTo(footer);
$('<button class="button"></button>').text("Cancel").click(function() { $('<button class="button"></button>').text($.i18n._('fb-buttons')["cancel"]).click(function() {
DialogSystem.dismissUntil(level - 1); DialogSystem.dismissUntil(level - 1);
}).appendTo(footer); }).appendTo(footer);

View File

@ -33,6 +33,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var FreebaseExtension = { handlers: {} }; var FreebaseExtension = { handlers: {} };
// Internationalization init
var lang = navigator.language.split("-")[0]
|| navigator.userLanguage.split("-")[0];
var dictionary = "";
$.ajax({
url : "/command/freebase/load-language?",
type : "POST",
async : false,
data : {
lng : lang
},
success : function(data) {
dictionary = data;
}
});
$.i18n.setDictionary(dictionary);
// End internationalization
FreebaseExtension.handlers.setFreebaseApiKey = function() { FreebaseExtension.handlers.setFreebaseApiKey = function() {
var value = window.prompt("Set Freebase API Key:"); var value = window.prompt("Set Freebase API Key:");
if (value !== null) { if (value !== null) {
@ -79,7 +98,7 @@ FreebaseExtension.handlers.browseToDataLoad = function() {
null, null,
function(data) { function(data) {
if (data.value == null) { if (data.value == null) {
alert("You have not tried to load the data in this project into Freebase yet."); alert($.i18n._('fb-menu')["warning-load"]);
} else { } else {
$(form).attr("action", "http://refinery.freebaseapps.com/load/" + data.value); $(form).attr("action", "http://refinery.freebaseapps.com/load/" + data.value);
form.submit(); form.submit();
@ -101,33 +120,35 @@ FreebaseExtension.handlers.importQAData = function() {
}; };
ExtensionBar.addExtensionMenu({ ExtensionBar.addExtensionMenu({
"id" : "freebase", "id" : "freebase",
"label" : "Freebase", "label" : $.i18n._('fb-menu')["freebase"],
"submenu" : [ "submenu" : [
{ {
"id" : "freebase/set-api-key", "id" : "freebase/set-api-key",
label: "Set Freebase API Key", label: $.i18n._('fb-menu')["set-api-key"],
click: FreebaseExtension.handlers.setFreebaseApiKey click: FreebaseExtension.handlers.setFreebaseApiKey
}, },
{ {
"id" : "freebase/schema-alignment", "id" : "freebase/schema-alignment",
label: "Align to Freebase's schemas...", label: $.i18n._('fb-menu')["align-schema"],
click: function() { FreebaseExtension.handlers.editSchemaAlignment(false); } click: function() { FreebaseExtension.handlers.editSchemaAlignment(false); }
}, },
{ {
"id" : "freebase/load-info-freebase", "id" : "freebase/load-info-freebase",
label: "Load into Freebase...", label: $.i18n._('fb-menu')["load"],
click: function() { FreebaseExtension.handlers.loadIntoFreebase(); } click: function() { FreebaseExtension.handlers.loadIntoFreebase(); }
}, },
{}, {},
{ {
"id" : "freebase/browse-load", "id" : "freebase/browse-load",
label: "Browse data load details...", label: $.i18n._('fb-menu')["browse-data-load"],
click: function() { FreebaseExtension.handlers.browseToDataLoad(); } click: function() { FreebaseExtension.handlers.browseToDataLoad(); }
}, },
{ {
"id" : "freebase/import-qa-data", "id" : "freebase/import-qa-data",
label: "Import QA data", label: $.i18n._('fb-menu')["import-qa"],
click: function() { FreebaseExtension.handlers.importQAData(); } click: function() { FreebaseExtension.handlers.importQAData(); }
} }
] ]
@ -163,7 +184,7 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
[ "core/edit-column", "core/add-column-by-fetching-urls" ], [ "core/edit-column", "core/add-column-by-fetching-urls" ],
{ {
id: "freebase/add-columns-from-freebase", id: "freebase/add-columns-from-freebase",
label: "Add columns from Freebase ...", label: $.i18n._('fb-menu')["add-columns"],
click: doAddColumnFromFreebase click: doAddColumnFromFreebase
} }
); );

View File

@ -0,0 +1,73 @@
package com.google.refine.freebase.commands;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext()
.getRealPath("extensions/freebase/module/langs/");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "");
BufferedReader reader = null;String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
}
if (param == null) param = request.getParameter("lng");
String[] langs = param.split(" ");
try {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e1) {
try {
String file = cleanedDirectory + File.separator + "translation-default.json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e3) {
e3.printStackTrace();
}
}
String line = null;
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
}
}

View File

@ -43,6 +43,7 @@ function init() {
var RS = Packages.com.google.refine.RefineServlet; var RS = Packages.com.google.refine.RefineServlet;
RS.registerCommand(module, "deauthorize", Packages.com.google.refine.extension.gdata.DeAuthorizeCommand()); RS.registerCommand(module, "deauthorize", Packages.com.google.refine.extension.gdata.DeAuthorizeCommand());
RS.registerCommand(module, "upload", Packages.com.google.refine.extension.gdata.UploadCommand()); RS.registerCommand(module, "upload", Packages.com.google.refine.extension.gdata.UploadCommand());
RS.registerCommand(module, "load-language", Packages.com.google.refine.extension.gdata.commands.LoadLanguageCommand());
// Register importer and exporter // Register importer and exporter
var IM = Packages.com.google.refine.importing.ImportingManager; var IM = Packages.com.google.refine.importing.ImportingManager;

View File

@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>OpenRefine - Authorization</title> <title id="gdata-authorize"></title>
</head> </head>
<body> <body>
<script> <script>

View File

@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<title>OpenRefine - Authorized</title> <title>OpenRefine - Authorized</title>
</head> </head>
<body> <body>
Authorization process completed. Close this window and return to OpenRefine. <span id="gdata-authorized"></span>
<script> <script>
var windowName = "$winname"; var windowName = "$winname";

View File

@ -0,0 +1,56 @@
{
"gdata-import": {
"preparing": "Preparing ...",
"creating": "Creating project ...",
"title": "Public Documents",
"import-by-url": "Import a <em>public</em> Google Spreadsheet or Fusion Table by its URL:",
"next->": "Next &raquo;",
"auth-doc": "Authorized Documents",
"please": "Please",
"sign-in": "sign in and authorize",
"sign-out": "sign out",
"access-data": "access to your Google data.",
"retrieving": "Retrieving Google Docs documents ...",
"re-sign-in": "re-sign in",
"another-account": "with another account"
},
"gdata-parsing": {
"start-over": "&laquo; Start Over",
"conf-pars": "Configure Parsing Options",
"proj-name": "Project&nbsp;name",
"create-proj": "Create Project &raquo;",
"updating-preview": "Updating preview ...",
"worksheet": "Worksheets",
"option": "Options",
"preview-button": "Update&nbsp;Preview",
"ignore-first": "Ignore first",
"ignore": "line(s) at beginning of file",
"parse-next": "Parse next",
"parse": "line(s) as column headers",
"discard-next": "Discard initial",
"discard": "row(s) of data",
"limit-next": "Load at most",
"limit": "row(s) of data",
"store-row": "Store blank rows",
"store-cell": "Store blank cells as nulls"
},
"gdata-source": {
"alert-url": "You must specify a web address (URL) to import.",
"type": "Type",
"title": "Title",
"authors": "Authors",
"updated": "Updated"
},
"gdata-exporter": {
"uploading": "Uploading...",
"upload-error": "Upload error: ",
"new-spreadsheet": "A new Google spreadsheet",
"enter-spreadsheet": "Enter a name for the new Google spreadsheet",
"new-fusion": "A new Google Fusion table",
"enter-fusion": "Enter a name for the new Google Fusion table"
},
"gdata-auth": {
"authorize-label": "OpenRefine - Authorization",
"authorized-label": "Authorization process completed. Close this window and return to OpenRefine."
}
}

View File

@ -0,0 +1,56 @@
{
"gdata-import": {
"preparing": "Preparing ...",
"creating": "Creating project ...",
"title": "Public Documents",
"import-by-url": "Import a <em>public</em> Google Spreadsheet or Fusion Table by its URL:",
"next->": "Next &raquo;",
"auth-doc": "Authorized Documents",
"please": "Please",
"sign-in": "sign in and authorize",
"sign-out": "sign out",
"access-data": "access to your Google data.",
"retrieving": "Retrieving Google Docs documents ...",
"re-sign-in": "re-sign in",
"another-account": "with another account"
},
"gdata-parsing": {
"start-over": "&laquo; Start Over",
"conf-pars": "Configure Parsing Options",
"proj-name": "Project&nbsp;name",
"create-proj": "Create Project &raquo;",
"updating-preview": "Updating preview ...",
"worksheet": "Worksheets",
"option": "Options",
"preview-button": "Update&nbsp;Preview",
"ignore-first": "Ignore first",
"ignore": "line(s) at beginning of file",
"parse-next": "Parse next",
"parse": "line(s) as column headers",
"discard-next": "Discard initial",
"discard": "row(s) of data",
"limit-next": "Load at most",
"limit": "row(s) of data",
"store-row": "Store blank rows",
"store-cell": "Store blank cells as nulls"
},
"gdata-source": {
"alert-url": "You must specify a web address (URL) to import.",
"type": "Type",
"title": "Title",
"authors": "Authors",
"updated": "Updated"
},
"gdata-exporter": {
"uploading": "Uploading...",
"upload-error": "Upload error: ",
"new-spreadsheet": "A new Google spreadsheet",
"enter-spreadsheet": "Enter a name for the new Google spreadsheet",
"new-fusion": "A new Google Fusion table",
"enter-fusion": "Enter a name for the new Google Fusion table"
},
"gdata-auth": {
"authorize-label": "OpenRefine - Authorization",
"authorized-label": "Authorization process completed. Close this window and return to OpenRefine."
}
}

View File

@ -0,0 +1,56 @@
{
"gdata-import": {
"preparing": "In preparazione ...",
"creating": "Creazione il progetto ...",
"title": "Documenti Pubblici",
"import-by-url": "Importa un Google Spreadsheet o Fusion Table <em>pubblico</em> inserendo l'URL:",
"next->": "Avanti &raquo;",
"auth-doc": "Documenti Autorizzati",
"please": "Per piacere",
"sign-in": "autenticati ed autorizza",
"sign-out": "esci",
"access-data": "accedi ai tuoi dati Google.",
"retrieving": "Recuperando i documenti Google Doc ...",
"re-sign-in": "rieffettua l'autenticazione",
"another-account": "con un altro account"
},
"gdata-parsing": {
"start-over": "&laquo; Ricomincia",
"conf-pars": "Configura le opzioni per il parsing",
"proj-name": "Nome&nbsp;del&nbsp;progetto",
"create-proj": "Crea un progetto &raquo;",
"updating-preview": "Aggiornando la preview ...",
"worksheet": "Worksheets",
"option": "Opzioni",
"preview-button": "Aggiorna&nbsp;la&nbsp;Preview",
"ignore-first": "Ignora le prime",
"ignore": "linee all'inizio del file",
"parse-next": "Parsa le prossime",
"parse": "linee come nomi delle colonne",
"discard-next": "Scarta le prime",
"discard": "righe di dati",
"limit-next": "Carica al massimo",
"limit": "righe di dati",
"store-row": "Salva righe vuote",
"store-cell": "Salva le celle vuote come 'null'"
},
"gdata-source": {
"alert-url": "Devi specificare un indirizzo web (URL) per l'import.",
"type": "Tipo",
"title": "Titolo",
"authors": "Autori",
"updated": "Aggiornato"
},
"gdata-exporter": {
"uploading": "Caricando...",
"upload-error": "Errore durante il caricamento: ",
"new-spreadsheet": "Un nuovo Google spreadsheet",
"enter-spreadsheet": "Inserisci un nome per il nuovo Google spreadsheet",
"new-fusion": "Una nuova tabella Google Fusion",
"enter-fusion": "Inserisci un nome per la nuova tabella Google Fusion"
},
"gdata-auth": {
"authorize-label": "OpenRefine - Autorizzazione",
"authorized-label": "Processo di autorizzazione completato. Chiudi questa finestra e torna ad OpenRefine."
}
}

View File

@ -1,39 +1,39 @@
<div bind="wizardHeader" class="gdata-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr> <div bind="wizardHeader" class="gdata-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr>
<td width="1%"><button bind="startOverButton" class="button">&laquo; Start Over</button></td> <td width="1%"><button bind="startOverButton" class="button">&laquo; Start Over</button></td>
<td width="98%">Configure Parsing Options</td> <td width="98%" bind="gdata_conf_pars"></td>
<td style="text-align: right;">Project&nbsp;name</td> <td style="text-align: right;" bind="gdata_proj_name"></td>
<td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td> <td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td>
<td width="1%"><button bind="createProjectButton" class="button button-primary">Create Project &raquo;</button></td> <td width="1%"><button bind="createProjectButton" class="button button-primary"></button></td>
</tr></table></div></div> </tr></table></div></div>
<div bind="dataPanel" class="gdata-importing-parsing-data-panel"></div> <div bind="dataPanel" class="gdata-importing-parsing-data-panel"></div>
<div bind="progressPanel" class="gdata-importing-progress-data-panel"> <div bind="progressPanel" class="gdata-importing-progress-data-panel">
<img src="images/large-spinner.gif" /> Updating preview ... <img src="images/large-spinner.gif" /> <span bind="gdata-updating"></span>
</div> </div>
<div bind="controlPanel" class="gdata-importing-parsing-control-panel"><div class="grid-layout layout-normal"><table> <div bind="controlPanel" class="gdata-importing-parsing-control-panel"><div class="grid-layout layout-normal"><table>
<tr> <tr>
<td>Options</td> <td bind="gdata-options"></td>
<td><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip"/></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip"/></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" bind="gdata_discard_next"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" bind="gdata_discard"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" bind="gdata_limit_next"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" bind="gdata_limit"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" bind="gdata_store_row"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" bind="gdata_store_cell"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div></div> </table></div></div>

View File

@ -1,51 +1,51 @@
<div bind="wizardHeader" class="gdata-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr> <div bind="wizardHeader" class="gdata-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr>
<td width="1%"><button bind="startOverButton" class="button">&laquo; Start Over</button></td> <td width="1%"><button bind="startOverButton" class="button"></button></td>
<td width="98%">Configure Parsing Options</td> <td width="98%" bind="gdata_conf_pars"></td>
<td style="text-align: right;">Project&nbsp;name</td> <td style="text-align: right;" bind="gdata_proj_name"></td>
<td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td> <td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td>
<td width="1%"><button bind="createProjectButton" class="button button-primary">Create Project &raquo;</button></td> <td width="1%"><button bind="createProjectButton" class="button button-primary"></button></td>
</tr></table></div></div> </tr></table></div></div>
<div bind="dataPanel" class="gdata-importing-parsing-data-panel"></div> <div bind="dataPanel" class="gdata-importing-parsing-data-panel"></div>
<div bind="progressPanel" class="gdata-importing-progress-data-panel"> <div bind="progressPanel" class="gdata-importing-progress-data-panel">
<img src="images/large-spinner.gif" /> Updating preview ... <img src="images/large-spinner.gif" /> <span bind="gdata-updating"></span>
</div> </div>
<div bind="controlPanel" class="gdata-importing-parsing-control-panel"><div class="grid-layout layout-normal"><table> <div bind="controlPanel" class="gdata-importing-parsing-control-panel"><div class="grid-layout layout-normal"><table>
<tr> <tr>
<td>Worksheets</td> <td bind="gdata-worksheet"></td>
<td colspan="2">Options</td> <td colspan="2" bind="gdata-options"></td>
<td rowspan="2"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td rowspan="2"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
<tr> <tr>
<td rowspan="2" width="40%"><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"></table></div></td> <td rowspan="2" width="40%"><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"></table></div></td>
<td colspan="2"><div class="grid-layout layout-tightest"><table> <td colspan="2"><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td> <tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
<td><label for="$ignore">Ignore first</label></td> <td><label for="$ignore" bind="gdata_ignore_first"></label></td>
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
<label for="$ignore">line(s) at beginning of file</label></td></tr> <label for="$ignore" bind="gdata_ignore"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td> <tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
<td><label for="$headers">Parse next</label></td> <td><label for="$headers" bind="gdata_parse_next"></label></td>
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> <td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
<label for="$headers">line(s) as column headers</label></td></tr> <label for="$headers" bind="gdata_parse"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" bind="gdata_discard_next"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" bind="gdata_discard"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" bind="gdata_limit_next"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" bind="gdata_limit"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" bind="gdata_store_row"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" bind="gdata_store_cell"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div></div> </table></div></div>

View File

@ -41,6 +41,18 @@ Refine.GDataSourceUI.prototype.attachUI = function(body) {
this._body.html(DOM.loadHTML("gdata", "scripts/index/import-from-gdata-form.html")); this._body.html(DOM.loadHTML("gdata", "scripts/index/import-from-gdata-form.html"));
this._elmts = DOM.bind(this._body); this._elmts = DOM.bind(this._body);
$('#gdata-title').text($.i18n._("gdata-import")["title"]);
$('#gdata-import').html($.i18n._("gdata-import")["import-by-url"]);
$('#gdata-next').html($.i18n._("gdata-import")["next->"]);
$('#gdata-auth-doc').text($.i18n._("gdata-import")["auth-doc"]);
$('#gdata-please').text($.i18n._("gdata-import")["please"]);
$('#gdata-signin-btn').text($.i18n._("gdata-import")["sign-in"]);
$('#gdata-access-data').text($.i18n._("gdata-import")["access-data"]);
$('#gdata-retrieving').text($.i18n._("gdata-import")["retrieving"]);
$('#gdata-retrieving').text($.i18n._("gdata-import")["sign-out"]);
$('#gdata-resignin').text($.i18n._("gdata-import")["re-sign-in"]);
$('#gdata-another-account').text($.i18n._("gdata-import")["another-account"]);
var self = this; var self = this;
this._body.find('.gdata-signin.button').click(function() { this._body.find('.gdata-signin.button').click(function() {
GdataExtension.showAuthorizationDialog( GdataExtension.showAuthorizationDialog(
@ -62,7 +74,7 @@ Refine.GDataSourceUI.prototype.attachUI = function(body) {
this._elmts.urlNextButton.click(function(evt) { this._elmts.urlNextButton.click(function(evt) {
var url = $.trim(self._elmts.urlInput[0].value); var url = $.trim(self._elmts.urlInput[0].value);
if (url.length === 0) { if (url.length === 0) {
window.alert("You must specify a web address (URL) to import."); window.alert($.i18n._('gdata-source')["alert-url"]);
} else { } else {
var doc = {}; var doc = {};
doc.docSelfLink = url; doc.docSelfLink = url;
@ -112,10 +124,10 @@ Refine.GDataSourceUI.prototype._renderDocuments = function(o) {
var table = $( var table = $(
'<table><tr>' + '<table><tr>' +
'<th></th>' + // starred '<th></th>' + // starred
'<th>Type</th>' + '<th>'+$.i18n._('gdata-source')["type"]+'</th>' +
'<th>Title</th>' + '<th>'+$.i18n._('gdata-source')["title"]+'</th>' +
'<th>Authors</th>' + '<th>'+$.i18n._('gdata-source')["authors"]+'</th>' +
'<th>Updated</th>' + '<th>'+$.i18n._('gdata-source')["updated"]+'</th>' +
'</tr></table>' '</tr></table>'
).appendTo(this._elmts.listingContainer)[0]; ).appendTo(this._elmts.listingContainer)[0];

View File

@ -1,29 +1,29 @@
<div> <div>
<div bind="publicDocsPanel" class="gdata-panel"> <div bind="publicDocsPanel" class="gdata-panel">
<h1>Public Documents</h1> <h1 id="gdata-title"></h1>
<div class="grid-layout layout-tighter"><table> <div class="grid-layout layout-tighter"><table>
<tr><td colspan="2">Import a <em>public</em> Google Spreadsheet or Fusion Table by its URL:</td></tr> <tr><td colspan="2" id="gdata-import"></td></tr>
<tr bind="urlRow"> <tr bind="urlRow">
<td><input bind="urlInput" name="download" class="default-importing-web-url" /></td> <td><input bind="urlInput" name="download" class="default-importing-web-url" /></td>
<td><button bind="urlNextButton" class="button button-primary" type="button">Next &raquo;</button></td> <td><button bind="urlNextButton" class="button button-primary" type="button" id="gdata-next"></button></td>
</tr> </tr>
</table></div> </table></div>
</div> </div>
<div bind="authorizedDocsPanel" class="gdata-panel"> <div bind="authorizedDocsPanel" class="gdata-panel">
<h1>Authorized Documents</h1> <h1 id="gdata-auth-doc"></h1>
<div bind="signinPage" class="gdata-page"> <div bind="signinPage" class="gdata-page">
<p>Please <button class="gdata-signin button button-primary">sign in and authorize</button> <p><span id="gdata-please"></span> <button class="gdata-signin button button-primary" id="gdata-signin-btn"></button>
access to your Google data.</p> <span id="gdata-access-data"></p>
</div> </div>
<div bind="progressPage" class="gdata-page"> <div bind="progressPage" class="gdata-page">
<p><img src="images/large-spinner.gif" /> Retrieving Google Docs documents ...</p> <p><img src="images/large-spinner.gif" /> <span id="gdata-retrieving"></span></p>
</div> </div>
<div bind="listingPage" class="gdata-page grid-layout layout-normal"><table> <div bind="listingPage" class="gdata-page grid-layout layout-normal"><table>
<tr> <tr>
<td width="%"><button class="gdata-signout button">sign out</button></td> <td width="%"><button class="gdata-signout button" id="gdata-signout"></button></td>
<td><button class="gdata-signin button">re-sign in</button> with another account</td> <td><button class="gdata-signin button" id="gdata-resignin"></button> <span id="gdata-another-account"></span></td>
</tr> </tr>
<tr><td colspan="2"><div bind="listingContainer" class="grid-layout layout-tight gdata-document-container"></div></td></tr> <tr><td colspan="2"><div bind="listingContainer" class="grid-layout layout-tight gdata-document-container"></div></td></tr>
</table></div> </table></div>

View File

@ -31,6 +31,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
//Internationalization init
var lang = navigator.language.split("-")[0]
|| navigator.userLanguage.split("-")[0];
var dictionary = "";
$.ajax({
url : "/command/gdata/load-language?",
type : "POST",
async : false,
data : {
lng : lang
},
success : function(data) {
dictionary = data;
}
});
$.i18n.setDictionary(dictionary);
// End internationalization
Refine.GDataImportingController = function(createProjectUI) { Refine.GDataImportingController = function(createProjectUI) {
this._createProjectUI = createProjectUI; this._createProjectUI = createProjectUI;
@ -41,11 +59,14 @@ Refine.GDataImportingController = function(createProjectUI) {
id: "gdata-source", id: "gdata-source",
ui: new Refine.GDataSourceUI(this) ui: new Refine.GDataSourceUI(this)
}); });
$('#gdata-authorize').text($.i18n._('gdata-auth')["authorize-label"]);
$('#gdata-authorized').text($.i18n._('gdata-auth')["authorized-label"]);
}; };
Refine.CreateProjectUI.controllers.push(Refine.GDataImportingController); Refine.CreateProjectUI.controllers.push(Refine.GDataImportingController);
Refine.GDataImportingController.prototype.startImportingDocument = function(doc) { Refine.GDataImportingController.prototype.startImportingDocument = function(doc) {
var dismiss = DialogSystem.showBusy("Preparing ..."); var dismiss = DialogSystem.showBusy($.i18n._('gdata-import')["preparing"]);
var self = this; var self = this;
$.post( $.post(
@ -143,6 +164,27 @@ Refine.GDataImportingController.prototype._showParsingPanel = function() {
'scripts/index/gdata-parsing-panel.html')); 'scripts/index/gdata-parsing-panel.html'));
this._parsingPanelElmts = DOM.bind(this._parsingPanel); this._parsingPanelElmts = DOM.bind(this._parsingPanel);
if(this._doc.type != 'table'){
this._parsingPanelElmts.gdata-worksheet.html($.i18n._('gdata-parsing')["worksheet"]);
this._parsingPanelElmts.gdata_ignore_first.html($.i18n._('gdata-parsing')["ignore-first"]);
this._parsingPanelElmts.gdata_ignore.html($.i18n._('gdata-parsing')["ignore"]);
this._parsingPanelElmts.gdata_parse_next.html($.i18n._('gdata-parsing')["parse-next"]);
this._parsingPanelElmts.gdata_parse.html($.i18n._('gdata-parsing')["parse"]);
}
this._parsingPanelElmts.startOverButton.html($.i18n._('gdata-parsing')["start-over"]);
this._parsingPanelElmts.gdata_conf_pars.html($.i18n._('gdata-parsing')["conf-pars"]);
this._parsingPanelElmts.gdata_proj_name.html($.i18n._('gdata-parsing')["proj-name"]);
this._parsingPanelElmts.createProjectButton.html($.i18n._('gdata-parsing')["create-proj"]);
this._parsingPanelElmts.gdata-options.html($.i18n._('gdata-parsing')["option"]);
this._parsingPanelElmts.previewButton.html($.i18n._('gdata-parsing')["preview-button"]);
this._parsingPanelElmts.gdata-updating.html($.i18n._('gdata-parsing')["updating-preview"]);
this._parsingPanelElmts.gdata_discard_next.html($.i18n._('gdata-parsing')["discard-next"]);
this._parsingPanelElmts.gdata_discard.html($.i18n._('gdata-parsing')["discard"]);
this._parsingPanelElmts.gdata_limit_next.html($.i18n._('gdata-parsing')["limit-next"]);
this._parsingPanelElmts.gdata_limit.html($.i18n._('gdata-parsing')["limit"]);
this._parsingPanelElmts.gdata_store_row.html($.i18n._('gdata-parsing')["store-row"]);
this._parsingPanelElmts.gdata_store_cell.html($.i18n._('gdata-parsing')["store-cell"]);
if (this._parsingPanelResizer) { if (this._parsingPanelResizer) {
$(window).unbind('resize', this._parsingPanelResizer); $(window).unbind('resize', this._parsingPanelResizer);
} }
@ -376,7 +418,7 @@ Refine.GDataImportingController.prototype._createProject = function() {
}, },
1000 1000
); );
self._createProjectUI.showImportProgressPanel("Creating project ...", function() { self._createProjectUI.showImportProgressPanel($.i18n._('gdata-import')["creating"], function() {
// stop the timed polling // stop the timed polling
window.clearInterval(timerID); window.clearInterval(timerID);

View File

@ -31,12 +31,27 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
var dictionary = "";
$.ajax({
url : "/command/gdata/load-language?",
type : "POST",
async : false,
data : {
lng : lang
},
success : function(data) {
dictionary = data;
}
});
$.i18n.setDictionary(dictionary);
// End internationalization
(function() { (function() {
var handleUpload = function(options, exportAllRows, onDone, prompt) { var handleUpload = function(options, exportAllRows, onDone, prompt) {
var doUpload = function() { var doUpload = function() {
var name = window.prompt(prompt, theProject.metadata.name); var name = window.prompt(prompt, theProject.metadata.name);
if (name) { if (name) {
var dismiss = DialogSystem.showBusy('Uploading...'); var dismiss = DialogSystem.showBusy($.i18n._('gdata-exporter')["uploading"]);
$.post( $.post(
"command/gdata/upload", "command/gdata/upload",
{ {
@ -52,7 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (o.url) { if (o.url) {
window.open(o.url, '_blank'); window.open(o.url, '_blank');
} else { } else {
alert('Upload error: ' + o.message) alert($.i18n._('gdata-exporter')["upload-error"] + o.message)
} }
onDone(); onDone();
}, },
@ -70,16 +85,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CustomTabularExporterDialog.uploadTargets.push({ CustomTabularExporterDialog.uploadTargets.push({
id: 'gdata/google-spreadsheet', id: 'gdata/google-spreadsheet',
label: 'A new Google spreadsheet', label: $.i18n._('gdata-exporter')["new-spreadsheet"],
handler: function(options, exportAllRows, onDone) { handler: function(options, exportAllRows, onDone) {
handleUpload(options, exportAllRows, onDone, 'Enter a name for the new Google spreadsheet'); handleUpload(options, exportAllRows, onDone, $.i18n._('gdata-exporter')["enter-spreadsheet"]);
} }
}); });
CustomTabularExporterDialog.uploadTargets.push({ CustomTabularExporterDialog.uploadTargets.push({
id: 'gdata/fusion-table', id: 'gdata/fusion-table',
label: 'A new Google Fusion table', label: $.i18n._('gdata-exporter')["new-fusion"],
handler: function(options, exportAllRows, onDone) { handler: function(options, exportAllRows, onDone) {
handleUpload(options, exportAllRows, onDone, 'Enter a name for the new Google Fusion table'); handleUpload(options, exportAllRows, onDone, $.i18n._('gdata-exporter')["enter-fusion"]);
} }
}); });
})(); })();

View File

@ -0,0 +1,74 @@
package com.google.refine.extension.gdata.commands;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext()
.getRealPath("extensions/gdata/module/langs/");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "");
BufferedReader reader = null;
String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
}
if (param == null) param = request.getParameter("lng");
String[] langs = param.split(" ");
try {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e1) {
try {
String file = cleanedDirectory + File.separator + "translation-default.json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e3) {
e3.printStackTrace();
}
}
String line = null;
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
}
}

View File

@ -0,0 +1,73 @@
package com.google.refine.commands.lang;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
public class LoadLanguageCommand extends Command {
public LoadLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String rawDirectoryFile = request.getSession().getServletContext().getRealPath("webapp/modules/langs/");
String cleanedDirectory = rawDirectoryFile.replace("main" + File.separator + "webapp" + File.separator, "main"
+ File.separator);
BufferedReader reader = null;
String param = null;
try {
param = (String) ProjectManager.singleton.getPreferenceStore().get("userLang");
} catch (NullPointerException e) {
}
if (param == null) param = request.getParameter("lng");
String[] langs = param.split(" ");
try {
String file = cleanedDirectory + File.separator + "translation-" + langs[0] + ".json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e1) {
try {
String file = cleanedDirectory + File.separator + "translation-default.json";
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
} catch (FileNotFoundException e3) {
e3.printStackTrace();
}
}
String line = null;
String message = new String();
if (reader != null) {
while ((line = reader.readLine()) != null) {
// buffer.append(line);
message += line + System.getProperty("line.separator");
}
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(message);
response.getWriter().flush();
response.getWriter().close();
}
}

View File

@ -0,0 +1,33 @@
package com.google.refine.commands.lang;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.refine.ProjectManager;
import com.google.refine.commands.Command;
import com.google.refine.preference.PreferenceStore;
public class SetLanguageCommand extends Command {
public SetLanguageCommand() {
// TODO Auto-generated constructor stub
}
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String lang = request.getParameter("lng");
PreferenceStore pref = ProjectManager.singleton.getPreferenceStore();
pref.put("userLang", lang);
}
}

View File

@ -98,6 +98,9 @@ function registerCommands() {
RS.registerCommand(module, "transpose-rows-into-columns", new Packages.com.google.refine.commands.cell.TransposeRowsIntoColumnsCommand()); RS.registerCommand(module, "transpose-rows-into-columns", new Packages.com.google.refine.commands.cell.TransposeRowsIntoColumnsCommand());
RS.registerCommand(module, "key-value-columnize", new Packages.com.google.refine.commands.cell.KeyValueColumnizeCommand()); RS.registerCommand(module, "key-value-columnize", new Packages.com.google.refine.commands.cell.KeyValueColumnizeCommand());
RS.registerCommand(module, "load-language", Packages.com.google.refine.commands.lang.LoadLanguageCommand());
RS.registerCommand(module, "set-language", Packages.com.google.refine.commands.lang.SetLanguageCommand());
RS.registerCommand(module, "add-column", new Packages.com.google.refine.commands.column.AddColumnCommand()); RS.registerCommand(module, "add-column", new Packages.com.google.refine.commands.column.AddColumnCommand());
RS.registerCommand(module, "add-column-by-fetching-urls", new Packages.com.google.refine.commands.column.AddColumnByFetchingURLsCommand()); RS.registerCommand(module, "add-column-by-fetching-urls", new Packages.com.google.refine.commands.column.AddColumnByFetchingURLsCommand());
RS.registerCommand(module, "remove-column", new Packages.com.google.refine.commands.column.RemoveColumnCommand()); RS.registerCommand(module, "remove-column", new Packages.com.google.refine.commands.column.RemoveColumnCommand());
@ -309,6 +312,7 @@ function init() {
"externals/jquery.eventstack-0.3.js", "externals/jquery.eventstack-0.3.js",
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js", "externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/date.js", "externals/date.js",
"externals/jquery.i18n.js",
"externals/CFInstall.min.js", "externals/CFInstall.min.js",
"scripts/chrome-frame.js", "scripts/chrome-frame.js",
@ -328,6 +332,7 @@ function init() {
"scripts/index/create-project-ui.js", "scripts/index/create-project-ui.js",
"scripts/index/open-project-ui.js", "scripts/index/open-project-ui.js",
"scripts/index/import-project-ui.js", "scripts/index/import-project-ui.js",
"scripts/index/lang-settings-ui.js",
"scripts/index/default-importing-controller/controller.js", "scripts/index/default-importing-controller/controller.js",
"scripts/index/default-importing-controller/file-selection-panel.js", "scripts/index/default-importing-controller/file-selection-panel.js",
@ -384,6 +389,7 @@ function init() {
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js", "externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/imgareaselect/jquery.imgareaselect.js", "externals/imgareaselect/jquery.imgareaselect.js",
"externals/date.js", "externals/date.js",
"externals/jquery.i18n.js",
"externals/CFInstall.min.js", "externals/CFInstall.min.js",
"scripts/chrome-frame.js", "scripts/chrome-frame.js",
@ -489,7 +495,8 @@ function init() {
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js", "externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
"externals/imgareaselect/jquery.imgareaselect.js", "externals/imgareaselect/jquery.imgareaselect.js",
"externals/date.js", "externals/date.js",
"scripts/preferences.js" "scripts/preferences.js",
"externals/jquery.i18n.js",
] ]
); );
ClientSideResourceManager.addPaths( ClientSideResourceManager.addPaths(

View File

@ -0,0 +1,2 @@
(function(f){f.i18n={dict:null,plural:null,setDictionary:function(a){null===this.dict?this.dict=a:f.extend(this.dict,a)},setPlural:function(a){this.plural=a},_p:function(a,d,e){var c=this.dict[a],b=[];b.push(e);if(void 0===c||null===this.plural)return this.printf(1<e?d:a,b);a=this.plural.replace(/n%/g,e+"%");eval(a);return this.printf(c[plural],b)},_:function(a,d){var e=a;this.dict&&this.dict[a]&&(e=this.dict[a]);return this.printf(e,d)},printf:function(a,d){if(!d)return a;for(var e="",c=/%(\d+)\$s/g,
b=c.exec(a);b;){var f=parseInt(b[1],10)-1;a=a.replace("%"+b[1]+"$s",d[f]);b=c.exec(a)}c=a.split("%s");if(1<c.length)for(b=0;b<d.length;b++)0<c[b].length&&c[b].lastIndexOf("%")==c[b].length-1&&(c[b]+="s"+c.splice(b+1,1)[0]),e+=c[b]+d[b];return e+c[c.length-1]}};f.fn._t=function(a,d){return f(this).text(f.i18n._(a,d))}})(jQuery);

View File

@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<body> <body>
<div id="header"> <div id="header">
<img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /> <img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" />
<span id="slogan">A power tool for working with messy data.</span> <span id="slogan"></span>
</div> </div>
<div id="left-panel" class="main-layout-panel"><div id="left-panel-body"> <div id="left-panel" class="main-layout-panel"><div id="left-panel-body">
@ -58,8 +58,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="openrefine-version"></div> <div id="openrefine-version"></div>
</div> </div>
<ul> <ul>
<li><a href="http://github.com/OpenRefine/OpenRefine/wiki/DocumentationForUsers">Help</a></li> <li><a href="http://github.com/OpenRefine/OpenRefine/wiki/DocumentationForUsers" id="or-index-help"></a></li>
<li><a href="about.html">About</a></li> <li><a href="about.html" id="or-index-about"></a></li>
</ul> </ul>
</div> </div>
</div></div> <!-- left-panel --> </div></div> <!-- left-panel -->
@ -68,9 +68,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div></div> <!-- right-panel --> </div></div> <!-- right-panel -->
<div id="no-project-message" class="message" style="display: none;"> <div id="no-project-message" class="message" style="display: none;">
No existing project. Select "Create Project" on the left to create a new project.<br/> <span id="or-index-noProj"></span><br/>
If you have no data to work with, try these <span id="or-index-try"></span>
<a href="http://github.com/OpenRefine/OpenRefine/wiki/SampleDatasets" target="_blank">sample data sets</a>. <a href="http://code.google.com/p/google-refine/wiki/SampleDatasets" target="_blank" id="or-index-sample"></a>.
</div> </div>
</body> </body>
</html> </html>

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div> </div>
<div id="body-info"> <div id="body-info">
<div id="loading-message"><img src="images/large-spinner.gif" /> Loading...</div> <div id="loading-message"><img src="images/large-spinner.gif" /> <span id="or-proj-starting"></span></div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -47,24 +47,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<div id="header"> <div id="header">
<a id="app-home-button" href="./"><img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /></a> <a id="app-home-button" href="./"><img alt="OpenRefine" src="images/logo-openrefine-30.png" width="129" height="29" /></a>
<div id="project-title"> <div id="project-title">
<span id="project-name-button" class="app-path-section" title="Click to rename project"></span> <span id="project-name-button" class="app-path-section"></span>
<a id="project-permalink-button" href="javascript:{}" class="secondary">Permalink</a> <a id="project-permalink-button" href="javascript:{}" class="secondary"></a>
</div> </div>
<div id="project-controls"> <div id="project-controls">
<a href="./" class="button" target="_blank">Open...</a> <a href="./" class="button" target="_blank"><span id="or-proj-open"></span></a>
<a class="button" bind="exportButton" id="export-button" href="#export"><span class="button-menu">Export</span></a> <a class="button" bind="exportButton" id="export-button" href="#export"><span class="button-menu" id="or-proj-export"></span></a>
<a href="http://github.com/OpenRefine/OpenRefine/wiki/DocumentationForUsers" target="_blank" class="button">Help</a> <a href="http://github.com/OpenRefine/OpenRefine/wiki/DocumentationForUsers" target="_blank" class="button"><span id="or-proj-help"></span></a>
</div> </div>
</div> </div>
<div id="loading-message"><img src="images/large-spinner.gif" /> Starting up...</div> <div id="loading-message"><img src="images/large-spinner.gif" /> <span id="or-proj-starting"></span></div>
<div id="body"> <div id="body">
<div bind="leftPanelDiv" id="left-panel"> <div bind="leftPanelDiv" id="left-panel">
<div bind="leftPanelTabs" class="refine-tabs"> <div bind="leftPanelTabs" class="refine-tabs">
<ul> <ul>
<li><a href="#refine-tabs-facets">Facet / Filter</a></li> <li><a href="#refine-tabs-facets" id="or-proj-facFil"></a></li>
<li><a href="#refine-tabs-history" bind="historyTabHeader">Undo / Redo</a></li> <li><a href="#refine-tabs-history" bind="historyTabHeader" id="or-proj-undoRedo"></a></li>
</ul> </ul>
<div id="refine-tabs-facets" bind="facetPanelDiv" id="facet-panel"></div> <div id="refine-tabs-facets" bind="facetPanelDiv" id="facet-panel"></div>
<div id="refine-tabs-history" bind="historyPanelDiv" id="history-panel"></div> <div id="refine-tabs-history" bind="historyPanelDiv" id="history-panel"></div>
@ -76,7 +76,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<!-- row/record counts --> <!-- row/record counts -->
</div> </div>
<div bind="extensionBarDiv" id="extension-bar"> <div bind="extensionBarDiv" id="extension-bar">
Extensions: <span bind="menuContainer" id="extension-bar-menu-container"></span> <span id="or-proj-ext"></span> <span bind="menuContainer" id="extension-bar-menu-container"></span>
</div> </div>
</div> </div>
<div bind="viewPanelDiv" id="view-panel"></div> <div bind="viewPanelDiv" id="view-panel"></div>

View File

@ -4,40 +4,38 @@
<div class="grid-layout layout-normal layout-full"><table> <div class="grid-layout layout-normal layout-full"><table>
<tr> <tr>
<td colspan="4"> <td colspan="4">
This feature helps you find groups of different cell values that might be <span bind="or_dialog_descr"></span>
alternative representations of the same thing. For example, the two strings <a href="https://github.com/OpenRefine/OpenRefine/wiki/Clustering" target="_blank" bind="or_dialog_findMore"></a>
"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.
<a href="https://github.com/OpenRefine/OpenRefine/wiki/Clustering" target="_blank">Find out more ...</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
Method&nbsp;<select bind="methodSelector"> <span bind="or_dialog_method"></span><select bind="methodSelector">
<option selected="true">key collision</option> <option selected="true" bind="or_dialog_keyCollision"></option>
<option>nearest neighbor</option> <option bind="or_dialog_neighbor"></option>
</select> </select>
</td> </td>
<td> <td>
<div class="binning-controls">Keying&nbsp;Function&nbsp;<select bind="keyingFunctionSelector"> <div class="binning-controls"><span bind="or_dialog_keying"></span>
<option selected="true">fingerprint</option> <select bind="keyingFunctionSelector">
<option>ngram-fingerprint</option> <option selected="true" bind="or_dialog_fingerprint"></option>
<option>metaphone3</option> <option bind="or_dialog_ngram"></option>
<option>cologne-phonetic</option> <option bind="or_dialog_metaphone"></option>
<option bind="or_dialog_phonetic"></option>
</select></div> </select></div>
<div class="knn-controls hidden">Distance&nbsp;Function&nbsp;<select bind="distanceFunctionSelector"> <div class="knn-controls hidden"><span bind="or_dialog_distance"></span>
<option selected="true">levenshtein</option> <select bind="distanceFunctionSelector">
<option>PPM</option> <option selected="true" bind="or_dialog_leven"></option>
<option bind="or_dialog_ppm"></option>
</select></div> </select></div>
</td> </td>
<td> <td>
<div id="ngram-fingerprint-params" class="function-params hidden"> <div id="ngram-fingerprint-params" class="function-params hidden">
Ngram&nbsp;Size&nbsp;<input type="text" value="2" bind="ngramSize" name="ngram-size" size="2" class="param" datatype="int"> <span bind="or_dialog_ngramSize"></span><input type="text" value="2" bind="ngramSize" name="ngram-size" size="2" class="param" datatype="int">
</div> </div>
<div class="knn-controls hidden"> <div class="knn-controls hidden">
<span style="margin-right: 1em">Radius&nbsp;<input type="text" value="1.0" bind="radius" name="radius" size="2" class="param" datatype="float"></span> <span style="margin-right: 1em"><span bind="or_dialog_radius"></span><input type="text" value="1.0" bind="radius" name="radius" size="2" class="param" datatype="float"></span>
<span>Block&nbsp;Chars&nbsp;<input type="text" value="6" bind="ngramBlock" name="blocking-ngram-size" size="2" class="param" datatype="int"></span> <span><span bind="or_dialog_blockChars"></span><input type="text" value="6" bind="ngramBlock" name="blocking-ngram-size" size="2" class="param" datatype="int"></span>
</div> </div>
</td> </td>
<td bind="resultSummary" style="text-align:right;"> <td bind="resultSummary" style="text-align:right;">
@ -54,13 +52,13 @@
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<table width="100%"><tr> <table width="100%"><tr>
<td class="left" style="text-align: left"> <td class="left" style="text-align: left">
<button class="button" bind="selectAllButton">Select All</button> <button class="button" bind="selectAllButton"></button>
<button class="button" bind="deselectAllButton">Deselect All</button> <button class="button" bind="deselectAllButton"></button>
</td> </td>
<td class="right" style="text-align: right"> <td class="right" style="text-align: right">
<button class="button button-primary" bind="applyReClusterButton">Merge Selected &amp; Re-Cluster</button> <button class="button button-primary" bind="applyReClusterButton"></button>
<button class="button" bind="applyCloseButton">Merge Selected &amp; Close</button> <button class="button" bind="applyCloseButton"></button>
<button class="button" bind="closeButton">Close</button> <button class="button" bind="closeButton"></button>
</td> </td>
</tr></table> </tr></table>
</div> </div>

View File

@ -49,16 +49,38 @@ ClusteringDialog.prototype._createDialog = function() {
var dialog = $(DOM.loadHTML("core", "scripts/dialogs/clustering-dialog.html")); var dialog = $(DOM.loadHTML("core", "scripts/dialogs/clustering-dialog.html"));
this._elmts = DOM.bind(dialog); 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() { this._elmts.methodSelector.change(function() {
var selection = $(this).find("option:selected").text(); 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(".binning-controls").show();
dialog.find(".knn-controls").hide(); dialog.find(".knn-controls").hide();
self._method = "binning"; self._method = "binning";
self._elmts.keyingFunctionSelector.change(); self._elmts.keyingFunctionSelector.change();
} else if (selection === 'nearest neighbor') { } else if (selection === $.i18n._('core-dialogs')["nearest-neighbor"]) {
dialog.find(".binning-controls").hide(); dialog.find(".binning-controls").hide();
dialog.find(".knn-controls").show(); dialog.find(".knn-controls").show();
self._method = "knn"; self._method = "knn";
@ -116,11 +138,11 @@ ClusteringDialog.prototype._renderTable = function(clusters) {
var trHead = table.insertRow(table.rows.length); var trHead = table.insertRow(table.rows.length);
trHead.className = "header"; trHead.className = "header";
$(trHead.insertCell(0)).text("Cluster Size"); $(trHead.insertCell(0)).text($.i18n._('core-dialogs')["cluster-size"]);
$(trHead.insertCell(1)).text("Row Count"); $(trHead.insertCell(1)).text($.i18n._('core-dialogs')["row-count"]);
$(trHead.insertCell(2)).text("Values in Cluster"); $(trHead.insertCell(2)).text($.i18n._('core-dialogs')["cluster-values"]);
$(trHead.insertCell(3)).text("Merge?"); $(trHead.insertCell(3)).text($.i18n._('core-dialogs')["merge"]);
$(trHead.insertCell(4)).text("New Cell Value"); $(trHead.insertCell(4)).text($.i18n._('core-dialogs')["new-cell-val"]);
var renderCluster = function(cluster) { var renderCluster = function(cluster) {
var tr = table.insertRow(table.rows.length); var tr = table.insertRow(table.rows.length);
@ -159,7 +181,7 @@ ClusteringDialog.prototype._renderTable = function(clusters) {
for (var c = 0; c < choices.length; c++) { for (var c = 0; c < choices.length; c++) {
var choice = choices[c]; var choice = choices[c];
var li = $('<li></li>'); var li = $('<li></li>');
$('<a href="javascript:{}" title="Use this value"></a>').text(choice.v).click(onClick).appendTo(li); $('<a href="javascript:{}" title='+$.i18n._('core-dialogs')["use-this-val"]+'></a>').text(choice.v).click(onClick).appendTo(li);
$('<span></span>').text("(" + choice.c + " rows)").addClass("clustering-dialog-entry-count").appendTo(li); $('<span></span>').text("(" + choice.c + " rows)").addClass("clustering-dialog-entry-count").appendTo(li);
rowCount += choice.c; rowCount += choice.c;
facet.s[c] = { facet.s[c] = {
@ -181,7 +203,7 @@ ClusteringDialog.prototype._renderTable = function(clusters) {
var div = $('<div></div>').addClass("clustering-dialog-value-focus"); var div = $('<div></div>').addClass("clustering-dialog-value-focus");
var browseLink = $('<a target="_new" title="Browse only these values">Browse this cluster</a>') var browseLink = $('<a target="_new" title="'+$.i18n._('core-dialogs')["browse-only-these"]+'">'+$.i18n._('core-dialogs')["browse-this-cluster"]+'</a>')
.addClass("clustering-dialog-browse-focus") .addClass("clustering-dialog-browse-focus")
.attr("href",url) .attr("href",url)
.css("visibility","hidden") .css("visibility","hidden")
@ -217,13 +239,13 @@ ClusteringDialog.prototype._renderTable = function(clusters) {
this._elmts.resultSummary.html( this._elmts.resultSummary.html(
(clusters.length === this._clusters.length) ? (clusters.length === this._clusters.length) ?
("<b>" + this._clusters.length + "</b> cluster" + ((this._clusters.length != 1) ? "s" : "") + " found") : ("<b>" + this._clusters.length + "</b> cluster" + ((this._clusters.length != 1) ? "s" : "") + " "+$.i18n._('core-dialogs')["found"]) :
("<b>" + clusters.length + "</b> cluster" + ((clusters.length != 1) ? "s" : "") + " filtered from <b>" + this._clusters.length + "</b> total") ("<b>" + clusters.length + "</b> cluster" + ((clusters.length != 1) ? "s" : "") + " "+$.i18n._('core-dialogs')["filtered-from"]+ this._clusters.length +$.i18n._('core-dialogs')["from-total"] )
); );
} else { } else {
container.html( container.html(
'<div style="margin: 2em;"><div style="font-size: 130%; color: #333;">No clusters were found with the selected method</div><div style="padding-top: 1em; font-size: 110%; color: #888;">Try selecting another method above or changing its parameters</div></div>' '<div style="margin: 2em;"><div style="font-size: 130%; color: #333;">'+$.i18n._('core-dialogs')["no-cluster-found"]+'</div><div style="padding-top: 1em; font-size: 110%; color: #888;">'+$.i18n._('core-dialogs')["try-another-method"]+'</div></div>'
); );
} }
}; };
@ -232,7 +254,7 @@ ClusteringDialog.prototype._cluster = function() {
var self = this; var self = this;
var container = this._elmts.tableContainer.html( var container = this._elmts.tableContainer.html(
'<div style="margin: 1em; font-size: 130%; color: #888;">Clustering... <img src="images/small-spinner.gif"></div>' '<div style="margin: 1em; font-size: 130%; color: #888;">'+$.i18n._('core-dialogs')["clustering"]+'<img src="images/small-spinner.gif"></div>'
); );
this._elmts.resultSummary.empty(); this._elmts.resultSummary.empty();
@ -346,7 +368,7 @@ ClusteringDialog.prototype._apply = function(onDone) {
} }
); );
} else { } 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._facets = [];
this._createFacet("# Choices in Cluster", "size"); this._createFacet($.i18n._('core-dialogs')["choices-in-cluster"], "size");
this._createFacet("# Rows in Cluster", "rowCount"); this._createFacet($.i18n._('core-dialogs')["rows-in-cluster"], "rowCount");
this._createFacet("Average Length of Choices", "avg"); this._createFacet($.i18n._('core-dialogs')["choice-avg-length"], "avg");
this._createFacet("Length Variance of Choices", "variance"); this._createFacet($.i18n._('core-dialogs')["choice-var-length"], "variance");
}; };
ClusteringDialog.prototype._createFacet = function(title, property) { ClusteringDialog.prototype._createFacet = function(title, property) {

View File

@ -1,9 +1,9 @@
<div class="dialog-frame" style="width: 600px;"> <div class="dialog-frame" style="width: 600px;">
<div class="dialog-header" bind="dialogHeader">Re-order / Remove Columns</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"><div class="grid-layout grid-layout-for-ui layout-normal layout-full"><table> <div class="dialog-body" bind="dialogBody"><div class="grid-layout grid-layout-for-ui layout-normal layout-full"><table>
<tr> <tr>
<td>Drag columns to re-order</td> <td bind="or_dialog_dragCol"></td>
<td>Drop columns here to remove</td> <td bind="or_dialog_dropCol"></td>
</tr> </tr>
<tr> <tr>
<td width="50%"><div class="column-reordering-dialog-column-container" bind="columnContainer"></div></td> <td width="50%"><div class="column-reordering-dialog-column-container" bind="columnContainer"></div></td>
@ -11,7 +11,7 @@
</tr> </tr>
</table></div></div> </table></div></div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="okButton">&nbsp;&nbsp;OK&nbsp;&nbsp;</button> <button class="button" bind="okButton"></button>
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</div> </div>
</div> </div>

View File

@ -39,9 +39,16 @@ ColumnReorderingDialog.prototype._createDialog = function() {
var self = this; var self = this;
var dialog = $(DOM.loadHTML("core", "scripts/dialogs/column-reordering-dialog.html")); var dialog = $(DOM.loadHTML("core", "scripts/dialogs/column-reordering-dialog.html"));
this._elmts = DOM.bind(dialog); this._elmts = DOM.bind(dialog);
this._elmts.cancelButton.click(function() { self._dismiss(); }); this._elmts.cancelButton.click(function() { self._dismiss(); });
this._elmts.okButton.click(function() { self._commit(); }); 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); this._level = DialogSystem.showDialog(dialog);
for (var i = 0; i < theProject.columnModel.columns.length; i++) { for (var i = 0; i < theProject.columnModel.columns.length; i++) {

View File

@ -1,91 +1,91 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-header" bind="dialogHeader">Custom Tabular Exporter</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div id="custom-tabular-exporter-tabs" class="refine-tabs"> <div id="custom-tabular-exporter-tabs" class="refine-tabs">
<ul> <ul>
<li><a href="#custom-tabular-exporter-tabs-content">Content</a></li> <li><a href="#custom-tabular-exporter-tabs-content" bind="or_dialog_content"></a></li>
<li><a href="#custom-tabular-exporter-tabs-download">Download</a></li> <li><a href="#custom-tabular-exporter-tabs-download" bind="or_dialog_download"></a></li>
<li bind="uploadTabHeader"><a href="#custom-tabular-exporter-tabs-upload">Upload</a></li> <li bind="uploadTabHeader"><a href="#custom-tabular-exporter-tabs-upload" bind="or_dialog_upload"></a></li>
<li><a href="#custom-tabular-exporter-tabs-code">Option Code</a></li> <li><a href="#custom-tabular-exporter-tabs-code" bind="or_dialog_optCode"></a></li>
</ul> </ul>
<div id="custom-tabular-exporter-tabs-content"><div class="grid-layout grid-layout-for-ui layout-normal layout-full"><table> <div id="custom-tabular-exporter-tabs-content"><div class="grid-layout grid-layout-for-ui layout-normal layout-full"><table>
<tr> <tr>
<td>Select and Order Columns to Export</td> <td bind="or_dialog_selAndOrd"></td>
<td>Options for <span bind="columnNameSpan" class="custom-tabular-exporter-selected-column"></span></td> <td><span bind="or_dialog_optFor"></span><span bind="columnNameSpan" class="custom-tabular-exporter-selected-column"></span></td>
</tr> </tr>
<tr> <tr>
<td width="40%"><div bind="columnList" class="custom-tabular-exporter-columns"></div></td> <td width="40%"><div bind="columnList" class="custom-tabular-exporter-columns"></div></td>
<td><div bind="columnOptionPane" class="custom-tabular-exporter-column-options"><div class="grid-layout layout-normal"><table> <td><div bind="columnOptionPane" class="custom-tabular-exporter-column-options"><div class="grid-layout layout-normal"><table>
<tr><td colspan="2">For reconciled cells, output</td></tr> <tr><td colspan="2" bind="or_dialog_forReconCell"></td></tr>
<tr><td><div class="grid-layout layout-tightest" ><table> <tr><td><div class="grid-layout layout-tightest" ><table>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="entity-name" id="$custom-exporter-recon-entity-name" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="entity-name" id="$custom-exporter-recon-entity-name" /></td>
<td><label for="$custom-exporter-recon-entity-name">Matched entity's name</label></td> <td><label for="$custom-exporter-recon-entity-name" bind="or_dialog_matchedName"></label></td>
<td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="cell-content" id="$custom-exporter-recon-cell-content" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="cell-content" id="$custom-exporter-recon-cell-content" /></td>
<td><label for="$custom-exporter-recon-cell-content">Cell's content</label></td> <td><label for="$custom-exporter-recon-cell-content" bind="or_dialog_cellCont"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="entity-id" id="$custom-exporter-recon-entity-id" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-recon" value="entity-id" id="$custom-exporter-recon-entity-id" /></td>
<td><label for="$custom-exporter-recon-entity-id">Matched entity's ID</label></td> <td><label for="$custom-exporter-recon-entity-id" bind="or_dialog_matchedId"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="checkbox" bind="reconLinkCheckbox" id="$custom-exporter-recon-link" /></td> <td width="1%"><input type="checkbox" bind="reconLinkCheckbox" id="$custom-exporter-recon-link" /></td>
<td width="50%"><label for="$custom-exporter-recon-link">Link to matched entity's page</label></td> <td width="50%"><label for="$custom-exporter-recon-link" bind="or_dialog_linkMatch"></label></td>
<td width="1%"><input type="checkbox" bind="reconBlankUnmatchedCheckbox" id="$custom-exporter-recon-blank-unmatched" /></td> <td width="1%"><input type="checkbox" bind="reconBlankUnmatchedCheckbox" id="$custom-exporter-recon-blank-unmatched" /></td>
<td width="50%"><label for="$custom-exporter-recon-blank-unmatched">Output nothing for unmatched cells</label></td> <td width="50%"><label for="$custom-exporter-recon-blank-unmatched" bind="or_dialog_outNotUnMatch"></label></td>
</tr> </tr>
</table></td></tr> </table></td></tr>
<tr><td colspan="2">For date/time values, use format</td></tr> <tr><td colspan="2" bind="or_dialog_dateFormat"></td></tr>
<tr><td><div class="grid-layout layout-tightest"><table> <tr><td><div class="grid-layout layout-tightest"><table>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="iso-8601" id="$custom-exporter-date-iso" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="iso-8601" id="$custom-exporter-date-iso" /></td>
<td colspan="3"><label for="$custom-exporter-date-iso">ISO 8601, e.g., 2011-08-24T18:36:10+08:00</label></td> <td colspan="3"><label for="$custom-exporter-date-iso" bind="or_dialog_dateIso"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-short" id="$custom-exporter-date-locale-short" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-short" id="$custom-exporter-date-locale-short" /></td>
<td width="50%"><label for="$custom-exporter-date-locale-short">Short locale format</label></td> <td width="50%"><label for="$custom-exporter-date-locale-short" bind="or_dialog_shortFormat"></label></td>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-medium" id="$custom-exporter-date-locale-medium" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-medium" id="$custom-exporter-date-locale-medium" /></td>
<td width="50%"><label for="$custom-exporter-date-locale-medium">Medium locale format</label></td> <td width="50%"><label for="$custom-exporter-date-locale-medium" bind="or_dialog_mediumFormat"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-long" id="$custom-exporter-date-locale-long" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-long" id="$custom-exporter-date-locale-long" /></td>
<td width="50%"><label for="$custom-exporter-date-locale-long">Long locale format</label></td> <td width="50%"><label for="$custom-exporter-date-locale-long" bind="or_dialog_longFormat"></label></td>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-full" id="$custom-exporter-date-locale-full" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="locale-full" id="$custom-exporter-date-locale-full" /></td>
<td width="50%"><label for="$custom-exporter-date-locale-full">Full locale format</label></td> <td width="50%"><label for="$custom-exporter-date-locale-full" bind="or_dialog_fullFormat"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="custom" id="$custom-exporter-date-custom" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-date" value="custom" id="$custom-exporter-date-custom" /></td>
<td colspan="3"> <td colspan="3">
<label for="$custom-exporter-date-custom">Custom</label> <input size="35" class="lightweight" bind="dateCustomInput" /> <label for="$custom-exporter-date-custom" bind="or_dialog_custom"></label> <input size="35" class="lightweight" bind="dateCustomInput" />
<a href="" target="_blank">Help</a> <a href="" target="_blank" bind="or_dialog_help"></a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="checkbox" bind="dateLocalTimeZoneCheckbox" id="$custom-exporter-date-local-timezone" /></td> <td width="1%"><input type="checkbox" bind="dateLocalTimeZoneCheckbox" id="$custom-exporter-date-local-timezone" /></td>
<td width="50%"><label for="$custom-exporter-date-local-timezone">Use local time zone</label></td> <td width="50%"><label for="$custom-exporter-date-local-timezone" bind="or_dialog_localTime"></label></td>
<td width="1%"><input type="checkbox" bind="omitTimeCheckbox" id="$custom-exporter-date-omit-time" /></td> <td width="1%"><input type="checkbox" bind="omitTimeCheckbox" id="$custom-exporter-date-omit-time" /></td>
<td width="50%"><label for="$custom-exporter-date-omit-time">Omit time</label></td> <td width="50%"><label for="$custom-exporter-date-omit-time" bind="or_dialog_omitTime"></label></td>
</tr> </tr>
</table></td></tr> </table></td></tr>
</table></div></div></td> </table></div></div></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<button class="button" bind="selectAllButton">Select All</button> <button class="button" bind="selectAllButton"></button>
<button class="button" bind="deselectAllButton">De-select All</button> <button class="button" bind="deselectAllButton"></button>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td width="1%"><input type="checkbox" bind="outputColumnHeadersCheckbox" checked id="$custom-exporter-output-column-headers" /></td> <td width="1%"><input type="checkbox" bind="outputColumnHeadersCheckbox" checked id="$custom-exporter-output-column-headers" /></td>
<td width="25%"><label for="$custom-exporter-output-column-headers">Output column headers</label></td> <td width="25%"><label for="$custom-exporter-output-column-headers" bind="or_dialog_outColHeader"></label></td>
<td width="1%"><input type="checkbox" bind="outputEmptyRowsCheckbox" id="$custom-exporter-output-empty-rows" /></td> <td width="1%"><input type="checkbox" bind="outputEmptyRowsCheckbox" id="$custom-exporter-output-empty-rows" /></td>
<td width="25%"><label for="$custom-exporter-output-empty-rows">Output empty rows (ie all cells null)</label></td> <td width="25%"><label for="$custom-exporter-output-empty-rows" bind="or_dialog_outEmptyRow"></label></td>
<td width="1%"><input type="checkbox" bind="exportAllRowsCheckbox" id="$custom-exporter-output-all-rows" /></td> <td width="1%"><input type="checkbox" bind="exportAllRowsCheckbox" id="$custom-exporter-output-all-rows" /></td>
<td width="50%"><label for="$custom-exporter-output-all-rows">Ignore facets and filters and export all rows</label></td> <td width="50%"><label for="$custom-exporter-output-all-rows" bind="or_dialog_ignoreFacets"></label></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
@ -94,48 +94,48 @@
<div id="custom-tabular-exporter-tabs-download" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table> <div id="custom-tabular-exporter-tabs-download" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table>
<tr> <tr>
<th>Line-based text formats</th> <th bind="or_dialog_lineFormat"></th>
<th>Other formats</th> <th bind="or_dialog_otherFormat"></th>
</tr> </tr>
<tr> <tr>
<td width="60%"><div class="grid-layout grid-layout-for-text layout-tightest"><table> <td width="60%"><div class="grid-layout grid-layout-for-text layout-tightest"><table>
<tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="tsv" checked id="$custom-exporter-download-tsv" /></td> <tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="tsv" checked id="$custom-exporter-download-tsv" /></td>
<td><label for="$custom-exporter-download-tsv">Tab-separated values (TSV)</label></td></tr> <td><label for="$custom-exporter-download-tsv" bind="or_dialog_tsv"></label></td></tr>
<tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="csv" id="$custom-exporter-download-csv" /></td> <tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="csv" id="$custom-exporter-download-csv" /></td>
<td><label for="$custom-exporter-download-csv">Comma-separated values (CSV)</label></td></tr> <td><label for="$custom-exporter-download-csv" bind="or_dialog_csv"></label></td></tr>
<tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="*sv" id="$custom-exporter-download-sv" /></td> <tr><td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="*sv" id="$custom-exporter-download-sv" /></td>
<td><label for="$custom-exporter-download-sv">Custom separator</label> <td><label for="$custom-exporter-download-sv" bind="or_dialog_customSep"></label>
<input type="text" class="lightweight" size="5" bind="separatorInput" /></td></tr> <input type="text" class="lightweight" size="5" bind="separatorInput" /></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout grid-layout-for-text layout-tightest"><table> <td><div class="grid-layout grid-layout-for-text layout-tightest"><table>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="xls" id="$custom-exporter-download-xls" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="xls" id="$custom-exporter-download-xls" /></td>
<td><label for="$custom-exporter-download-xls">Excel (.xls)</label></td> <td><label for="$custom-exporter-download-xls" bind="or_dialog_excel"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="xlsx" id="$custom-exporter-download-xlsx" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="xlsx" id="$custom-exporter-download-xlsx" /></td>
<td><label for="$custom-exporter-download-xlsx">Excel in XML (.xlsx)</label></td> <td><label for="$custom-exporter-download-xlsx" bind="or_dialog_excelXml"></label></td>
</tr> </tr>
<tr> <tr>
<td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="html" id="$custom-exporter-download-html" /></td> <td width="1%"><input type="radio" name="custom-tabular-exporter-download-format" value="html" id="$custom-exporter-download-html" /></td>
<td><label for="$custom-exporter-download-html">HTML table</label></td> <td><label for="$custom-exporter-download-html" bind="or_dialog_htmlTable"></label></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout grid-layout-for-text layout-tightest"><table> <td><div class="grid-layout grid-layout-for-text layout-tightest"><table>
<tr><td>Line separator</td><td><input type="text" size="5" class="lightweight" bind="lineSeparatorInput" /></td></tr> <tr><td bind="or_dialog_lineSep"></td><td><input type="text" size="5" class="lightweight" bind="lineSeparatorInput" /></td></tr>
<tr><td>Character encoding</td><td><input type="text" size="10" class="lightweight" bind="encodingInput" /></td></tr> <tr><td bind="or_dialog_charEnc"></td><td><input type="text" size="10" class="lightweight" bind="encodingInput" /></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><div class="grid-layout grid-layout-for-text layout-tightest layout-full"><table><tr> <td colspan="2"><div class="grid-layout grid-layout-for-text layout-tightest layout-full"><table><tr>
<td width="100%"> </td> <td width="100%"> </td>
<td width="1%"><button class="button" bind="downloadPreviewButton">Preview</button></td> <td width="1%"><button class="button" bind="downloadPreviewButton"></button></td>
<td width="1%"><button class="button button-primary" bind="downloadButton">Download</button></td> <td width="1%"><button class="button button-primary" bind="downloadButton"></button></td>
</tr></table></div></td> </tr></table></div></td>
</tr> </tr>
</table></div></div> </table></div></div>
@ -143,30 +143,27 @@
<div bind="uploadTabBody" id="custom-tabular-exporter-tabs-upload" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table> <div bind="uploadTabBody" id="custom-tabular-exporter-tabs-upload" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table>
<tr> <tr>
<th>Upload to</th> <th ><span bind="or_dialog_uploadTo"></span></th>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout grid-layout-for-text layout-tightest"><table bind="uploadTargetTable"></table></div></td> <td><div class="grid-layout grid-layout-for-text layout-tightest"><table bind="uploadTargetTable"></table></div></td>
</tr> </tr>
<tr> <tr>
<td><button class="button button-primary" bind="uploadButton">Upload</button></td> <td><button class="button button-primary" bind="uploadButton"></button></td>
</tr> </tr>
</table></div></div> </table></div></div>
<div id="custom-tabular-exporter-tabs-code" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table> <div id="custom-tabular-exporter-tabs-code" style="display: none;"><div class="grid-layout grid-layout-for-ui layout-loose layout-full"><table>
<tr> <tr>
<td>The following JSON text encodes the options you have set in the other tabs. <td bind="or_dialog_jsonText"></td>
You can copy it out and save it for later, and paste it back in and click Apply <td width="30%" style="text-align: right;"><button class="button" bind="applyOptionCodeButton"></button></td>
to re-use the same options.
</td>
<td width="30%" style="text-align: right;"><button class="button" bind="applyOptionCodeButton">Apply</button></td>
</tr> </tr>
<tr><td colspan="2"><textarea class="custom-tabular-exporter-code" bind="optionCodeInput"></textarea></td></tr> <tr><td colspan="2"><textarea class="custom-tabular-exporter-code" bind="optionCodeInput"></textarea></td></tr>
</table></div></div> </table></div></div>
</div> </div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-tightest layout-full"><table><tr> <div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-tightest layout-full"><table><tr>
<td><button class="button" bind="cancelButton">Cancel</button></td> <td><button class="button" bind="cancelButton"></button></td>
</tr></table></div></div> </tr></table></div></div>
</div> </div>

View File

@ -82,6 +82,51 @@ CustomTabularExporterDialog.prototype._createDialog = function(options) {
this._elmts.uploadTabBody.remove(); 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.or_dialog_uploadTo.html($.i18n._('core-dialogs')["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-content").css("display", "");
$("#custom-tabular-exporter-tabs-download").css("display", ""); $("#custom-tabular-exporter-tabs-download").css("display", "");
$("#custom-tabular-exporter-tabs-upload").css("display", ""); $("#custom-tabular-exporter-tabs-upload").css("display", "");
@ -326,9 +371,9 @@ CustomTabularExporterDialog.prototype._applyOptionCode = function() {
var json = JSON.parse(s); var json = JSON.parse(s);
this._configureUIFromOptionCode(json); this._configureUIFromOptionCode(json);
alert('Option code successfully applied.'); alert($.i18n._('core-dialogs')["opt-code-applied"]);
} catch (e) { } catch (e) {
alert('Error applying option code: ' + e); alert($.i18n._('core-dialogs')["error-apply-code"]+': ' + e);
} }
}; };

View File

@ -1,7 +1,7 @@
<div class="grid-layout layout-tight layout-full"><table rows="4" cols="4"> <div class="grid-layout layout-tight layout-full"><table rows="4" cols="4">
<tr style="vertical-align: bottom;"> <tr style="vertical-align: bottom;">
<td>Expression</td> <td bind="or_dialog_expr"></td>
<td style="text-align: right;">Language</td> <td style="text-align: right;" bind="or_dialog_lang"></td>
<td colspan="2"><select bind="expressionPreviewLanguageSelect">$LANGUAGE_OPTIONS$</select></td> <td colspan="2"><select bind="expressionPreviewLanguageSelect">$LANGUAGE_OPTIONS$</select></td>
</tr> </tr>
<tr> <tr>
@ -12,10 +12,10 @@
<td colspan="4"> <td colspan="4">
<div id="expression-preview-tabs" class="refine-tabs"> <div id="expression-preview-tabs" class="refine-tabs">
<ul> <ul>
<li><a href="#expression-preview-tabs-preview">Preview</a></li> <li><a href="#expression-preview-tabs-preview" bind="or_dialog_preview"></a></li>
<li><a href="#expression-preview-tabs-history">History</a></li> <li><a href="#expression-preview-tabs-history" bind="or_dialog_history"></a></li>
<li><a href="#expression-preview-tabs-starred">Starred</a></li> <li><a href="#expression-preview-tabs-starred" bind="or_dialog_starred"></a></li>
<li><a href="#expression-preview-tabs-help">Help</a></li> <li><a href="#expression-preview-tabs-help" bind="or_dialog_help"></a></li>
</ul> </ul>
<div id="expression-preview-tabs-preview"> <div id="expression-preview-tabs-preview">
<div class="expression-preview-container" bind="expressionPreviewPreviewContainer"></div> <div class="expression-preview-container" bind="expressionPreviewPreviewContainer"></div>

View File

@ -45,12 +45,12 @@ function ExpressionPreviewDialog(title, cellIndex, rowIndices, values, expressio
this._elmts = DOM.bind(html); this._elmts = DOM.bind(html);
$('<button class="button"></button>').html("&nbsp;&nbsp;OK&nbsp;&nbsp;").click(function() { $('<button class="button"></button>').html($.i18n._('core-buttons')["ok"]).click(function() {
DialogSystem.dismissUntil(self._level - 1); DialogSystem.dismissUntil(self._level - 1);
self._onDone(self._previewWidget.getExpression(true)); self._onDone(self._previewWidget.getExpression(true));
}).appendTo(footer); }).appendTo(footer);
$('<button class="button"></button>').text("Cancel").click(function() { $('<button class="button"></button>').text($.i18n._('core-buttons')["cancel"]).click(function() {
DialogSystem.dismissUntil(self._level - 1); DialogSystem.dismissUntil(self._level - 1);
}).appendTo(footer); }).appendTo(footer);
@ -139,6 +139,13 @@ ExpressionPreviewDialog.Widget = function(
this._tabContentWidth = this._elmts.expressionPreviewPreviewContainer.width() + "px"; 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.update();
this._renderExpressionHistoryTab(); this._renderExpressionHistoryTab();
this._renderStarredExpressionsTab(); this._renderStarredExpressionsTab();
@ -188,21 +195,19 @@ ExpressionPreviewDialog.Widget.prototype._renderHelp = function(data) {
var varTable = $('<table cellspacing="5"></table>').appendTo(elmt)[0]; var varTable = $('<table cellspacing="5"></table>').appendTo(elmt)[0];
var vars = [ var vars = [
{ name: "cell", { name: "cell",
description: "The current cell. It has a few fields: 'value' and 'recon'." description: $.i18n._('core-dialogs')["cell-fields"]
}, },
{ name: "value", { name: "value",
description: "The current cell's value. This is a shortcut for 'cell.value'." description: $.i18n._('core-dialogs')["cell-value"]
}, },
{ name: "row", { name: "row",
description: "The current row. It has 5 fields: 'flagged', 'starred', 'index', 'cells', and 'record'." description: $.i18n._('core-dialogs')["row-fields"]
}, },
{ name: "cells", { name: "cells",
description: "The cells of the current row. This is a shortcut for 'row.cells'. " + description: $.i18n._('core-dialogs')["cells-of-row"]
"A particular cell can be retrieved with 'cells.<column name>' if the <column name> is a single word, " +
"or with 'cells[\"<column name>\"] otherwise."
}, },
{ name: "rowIndex", { 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++) { 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 + ")"); $(tr0.insertCell(1)).addClass("expression-preview-doc-item-params").text("(" + entry.params + ")");
$(tr1.insertCell(0)); $(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(0));
$(tr2.insertCell(1)).addClass("expression-preview-doc-item-desc").text(entry.description); $(tr2.insertCell(1)).addClass("expression-preview-doc-item-desc").text(entry.description);
@ -268,7 +273,7 @@ ExpressionPreviewDialog.Widget.prototype._renderExpressionHistory = function(dat
var table = $( var table = $(
'<table>' + '<table>' +
'<tr><th></th><th></th><th>From</th><th colspan="2">Expression</th><th></th></tr>' + '<tr><th></th><th></th><th>'+$.i18n._('core-dialogs')["from"]+'</th><th colspan="2">'+$.i18n._('core-dialogs')["expression"]+'</th><th></th></tr>' +
'</table>' '</table>'
).appendTo($('<div>').addClass("expression-preview-table-wrapper").appendTo(elmt))[0]; ).appendTo($('<div>').addClass("expression-preview-table-wrapper").appendTo(elmt))[0];
@ -291,7 +296,7 @@ ExpressionPreviewDialog.Widget.prototype._renderExpressionHistory = function(dat
); );
}); });
$('<a href="javascript:{}">Reuse</a>').appendTo(tr.insertCell(1)).click(function() { $('<a href="javascript:{}">'+$.i18n._('core-dialogs')["reuse"]+'</a>').appendTo(tr.insertCell(1)).click(function() {
self._elmts.expressionPreviewTextarea[0].value = o.expression; self._elmts.expressionPreviewTextarea[0].value = o.expression;
self._elmts.expressionPreviewLanguageSelect[0].value = o.language; self._elmts.expressionPreviewLanguageSelect[0].value = o.language;
@ -334,7 +339,7 @@ ExpressionPreviewDialog.Widget.prototype._renderStarredExpressions = function(da
var table = $( var table = $(
'<table>' + '<table>' +
'<tr><th></th><th></th><th colspan="2">Expression</th><th></th></tr>' + '<tr><th></th><th></th><th colspan="2">'+$.i18n._('core-dialogs')["expression"]+'</th><th></th></tr>' +
'</table>' '</table>'
).appendTo($('<div>').addClass("expression-preview-table-wrapper").appendTo(elmt))[0]; ).appendTo($('<div>').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 tr = table.insertRow(table.rows.length);
var o = Scripting.parse(entry.code); var o = Scripting.parse(entry.code);
$('<a href="javascript:{}">Remove</a>').appendTo(tr.insertCell(0)).click(function() { $('<a href="javascript:{}">'+$.i18n._('core-dialogs')["remove"]+'</a>').appendTo(tr.insertCell(0)).click(function() {
$.post( $.post(
"command/core/toggle-starred-expression", "command/core/toggle-starred-expression",
{ expression: entry.code, returnList: true }, { expression: entry.code, returnList: true },
@ -427,7 +432,7 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
var renderValue = function(td, v) { var renderValue = function(td, v) {
if (v !== null && v !== undefined) { if (v !== null && v !== undefined) {
if ($.isPlainObject(v)) { if ($.isPlainObject(v)) {
$('<span></span>').addClass("expression-preview-special-value").text("Error: " + v.message).appendTo(td); $('<span></span>').addClass("expression-preview-special-value").text($.i18n._('core-dialogs')["error"]+": " + v.message).appendTo(td);
} else { } else {
td.text(v); td.text(v);
} }
@ -437,9 +442,9 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
}; };
if (this._results !== null) { 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 { } 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); this._elmts.expressionPreviewParsingStatus.empty().addClass("error").text(message);
} }

View File

@ -12,29 +12,29 @@
<table class="scatterplot-selectors"><tr> <table class="scatterplot-selectors"><tr>
<td nowrap> <td nowrap>
<div class="buttonset scatterplot-dim-selector" bind="plotSelector"> <div class="buttonset scatterplot-dim-selector" bind="plotSelector">
<input type="radio" id="clustering-dialog-dim-lin" name="clustering-dialog-dim" value="lin" checked="checked"/><label class="dim-lin-label" for="clustering-dialog-dim-lin" title="Linear Plot">lin</label> <input type="radio" id="clustering-dialog-dim-lin" name="clustering-dialog-dim" value="lin" checked="checked"/><label class="dim-lin-label" for="clustering-dialog-dim-lin" bind="or_dialog_linplot">lin</label>
<input type="radio" id="clustering-dialog-dim-log" name="clustering-dialog-dim" value="log"/><label class="dim-log-label" for="clustering-dialog-dim-log" title="Logarithmic Plot">log</label> <input type="radio" id="clustering-dialog-dim-log" name="clustering-dialog-dim" value="log"/><label class="dim-log-label" for="clustering-dialog-dim-log" bind="or_dialog_logplot">log</label>
</div> </div>
</td> </td>
<td nowrap> <td nowrap>
<div class="buttonset scatterplot-rot-selector" bind="rotationSelector"> <div class="buttonset scatterplot-rot-selector" bind="rotationSelector">
<input type="radio" id="clustering-dialog-rot-ccw" name="clustering-dialog-rot" value="ccw"/><label class="rot-ccw-label" for="clustering-dialog-rot-ccw" title="Rotated 45° Counter-Clockwise">&nbsp;</label> <input type="radio" id="clustering-dialog-rot-ccw" name="clustering-dialog-rot" value="ccw"/><label class="rot-ccw-label" for="clustering-dialog-rot-ccw" bind="or_dialog_counter">&nbsp;</label>
<input type="radio" id="clustering-dialog-rot-none" name="clustering-dialog-rot" value="none" checked="checked"/><label class="rot-none-label" for="clustering-dialog-rot-none" title="No rotation">&nbsp;</label> <input type="radio" id="clustering-dialog-rot-none" name="clustering-dialog-rot" value="none" checked="checked"/><label class="rot-none-label" for="clustering-dialog-rot-none" bind="or_dialog_norot">&nbsp;</label>
<input type="radio" id="clustering-dialog-rot-cw" name="clustering-dialog-rot" value="cw"/><label class="rot-cw-label" for="clustering-dialog-rot-cw" title="Rotated 45° Clockwise">&nbsp;</label> <input type="radio" id="clustering-dialog-rot-cw" name="clustering-dialog-rot" value="cw"/><label class="rot-cw-label" for="clustering-dialog-rot-cw" bind="or_dialog_clock">&nbsp;</label>
</div> </div>
</td> </td>
<td nowrap> <td nowrap>
<div class="buttonset scatterplot-dot-selector" bind="dotSelector"> <div class="buttonset scatterplot-dot-selector" bind="dotSelector">
<input type="radio" id="clustering-dialog-dot-small" name="clustering-dialog-dot" value="small"/><label class="dot-small-label" for="clustering-dialog-dot-small" title="Small Dot Size">&nbsp;</label> <input type="radio" id="clustering-dialog-dot-small" name="clustering-dialog-dot" value="small"/><label class="dot-small-label" for="clustering-dialog-dot-small" bind="or_dialog_smallDot">&nbsp;</label>
<input type="radio" id="clustering-dialog-dot-regular" name="clustering-dialog-dot" value="regular" checked="checked"/><label class="dot-regular-label" for="clustering-dialog-dot-regular" title="Regular Dot Size">&nbsp;</label> <input type="radio" id="clustering-dialog-dot-regular" name="clustering-dialog-dot" value="regular" checked="checked"/><label class="dot-regular-label" for="clustering-dialog-dot-regular" bind="or_dialog_regularDot">&nbsp;</label>
<input type="radio" id="clustering-dialog-dot-big" name="clustering-dialog-dot" value="big"/><label class="dot-big-label" for="clustering-dialog-dot-big" title="Big Dot Size">&nbsp;</label> <input type="radio" id="clustering-dialog-dot-big" name="clustering-dialog-dot" value="big"/><label class="dot-big-label" for="clustering-dialog-dot-big" bind="or_dialog_bigDot">&nbsp;</label>
</div> </div>
</td> </td>
</tr></table> </tr></table>
</div> </div>
</td> </td>
<td class="right" style="text-align: right"> <td class="right" style="text-align: right">
<button class="button" bind="closeButton">Close</button> <button class="button" bind="closeButton"></button>
</td> </td>
</tr></table> </tr></table>
</div> </div>

View File

@ -43,10 +43,19 @@ ScatterplotDialog.prototype._createDialog = function() {
var dialog = $(DOM.loadHTML("core", "scripts/dialogs/scatterplot-dialog.html")); var dialog = $(DOM.loadHTML("core", "scripts/dialogs/scatterplot-dialog.html"));
this._elmts = DOM.bind(dialog); this._elmts = DOM.bind(dialog);
this._elmts.dialogHeader.text( this._elmts.dialogHeader.text(
'Scatterplot Matrix' + $.i18n._('core-dialogs')["scatterplot-matrix"] +
((typeof this._column == "undefined") ? "" : " (focusing on '" + this._column + "')")); ((typeof this._column == "undefined") ? "" : " ("+$.i18n._('core-dialogs')["focusing-on"]+" '" + this._column + "')"));
this._elmts.closeButton.click(function() { self._dismiss(); }); 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() { this._elmts.plotSelector.buttonset().change(function() {
self._plot_method = $(this).find("input:checked").val(); self._plot_method = $(this).find("input:checked").val();
@ -78,7 +87,7 @@ ScatterplotDialog.prototype._renderMatrix = function() {
var self = this; var self = this;
var container = this._elmts.tableContainer.html( var container = this._elmts.tableContainer.html(
'<div style="margin: 1em; font-size: 130%; color: #888; background-color: white;">Processing... <img src="images/small-spinner.gif"></div>' '<div style="margin: 1em; font-size: 130%; color: #888; background-color: white;">'+$.i18n._('core-dialogs')["focusing-on"]+' <img src="images/small-spinner.gif"></div>'
); );
if (theProject.columnModel.columns.length > 0) { if (theProject.columnModel.columns.length > 0) {
@ -87,7 +96,7 @@ ScatterplotDialog.prototype._renderMatrix = function() {
}; };
$.getJSON("command/core/get-columns-info?" + $.param(params),function(data) { $.getJSON("command/core/get-columns-info?" + $.param(params),function(data) {
if (data === null || typeof data.length == 'undefined') { if (data === null || typeof data.length == 'undefined') {
container.html("Error calling 'get-columns-info'"); container.html($.i18n._('core-dialogs')["error-getColumnInfo"]);
return; return;
} }
@ -205,7 +214,7 @@ ScatterplotDialog.prototype._renderMatrix = function() {
}); });
} else { } else {
container.html( container.html(
'<div style="margin: 2em;"><div style="font-size: 130%; color: #333;">There are no columns in this dataset</div></div>' '<div style="margin: 2em;"><div style="font-size: 130%; color: #333;">'+$.i18n._('core-dialogs')["no-column-dataset"]+ '</div></div>'
); );
} }

View File

@ -1,16 +1,16 @@
<div class="dialog-frame" style="width: 900px;"> <div class="dialog-frame" style="width: 900px;">
<div class="dialog-header" bind="dialogHeader">Templating Export</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div class="grid-layout layout-normal layout-full"><table> <div class="grid-layout layout-normal layout-full"><table>
<tr> <tr>
<td style="vertical-align: top"><div class="grid-layout layout-tighter layout-full" bind="controls"><table> <td style="vertical-align: top"><div class="grid-layout layout-tighter layout-full" bind="controls"><table>
<tr><td>Prefix</td></tr> <tr><td bind="or_dialog_prefix"></td></tr>
<tr><td><div class="input-container"><textarea bind="prefixTextarea" class="code" wrap="off" style="height:5em;"></textarea></div></td></tr> <tr><td><div class="input-container"><textarea bind="prefixTextarea" class="code" wrap="off" style="height:5em;"></textarea></div></td></tr>
<tr><td>Row Template</td></tr> <tr><td bind="or_dialog_rowTmpl"></td></tr>
<tr><td><div class="input-container"><textarea bind="templateTextarea" class="code" wrap="off" style="height:20em;"></textarea></div></td></tr> <tr><td><div class="input-container"><textarea bind="templateTextarea" class="code" wrap="off" style="height:20em;"></textarea></div></td></tr>
<tr><td>Row Separator</td></tr> <tr><td bind="or_dialog_rowSep"></td></tr>
<tr><td><div class="input-container"><textarea bind="separatorTextarea" class="code" wrap="off" style="height:3em;"></textarea></div></td></tr> <tr><td><div class="input-container"><textarea bind="separatorTextarea" class="code" wrap="off" style="height:3em;"></textarea></div></td></tr>
<tr><td>Suffix</td></tr> <tr><td bind="or_dialog_suffix"></td></tr>
<tr><td><div class="input-container"><textarea bind="suffixTextarea" class="code" wrap="off" style="height:5em;"></textarea></div></td></tr> <tr><td><div class="input-container"><textarea bind="suffixTextarea" class="code" wrap="off" style="height:5em;"></textarea></div></td></tr>
</table></div></td> </table></div></td>
<td width="50%" style="vertical-align: top"> <td width="50%" style="vertical-align: top">
@ -21,11 +21,11 @@
</div> </div>
<div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr> <div class="dialog-footer" bind="dialogFooter"><div class="grid-layout layout-normal layout-full"><table><tr>
<td align="left"> <td align="left">
<button class="button" bind="resetButton">Reset Template</button> <button class="button" bind="resetButton"></button>
</td> </td>
<td style="text-align: right;"> <td style="text-align: right;">
<button class="button" bind="exportButton">Export</button> <button class="button" bind="exportButton"></button>
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</td> </td>
</tr></table></div></div> </tr></table></div></div>
</div> </div>

View File

@ -43,6 +43,15 @@ TemplatingExporterDialog.prototype._createDialog = function() {
this._elmts = DOM.bind(dialog); this._elmts = DOM.bind(dialog);
this._elmts.controls.find("textarea").bind("keyup change input",function() { self._scheduleUpdate(); }); 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.exportButton.click(function() { self._export(); self._dismiss(); });
this._elmts.cancelButton.click(function() { self._dismiss(); }); this._elmts.cancelButton.click(function() { self._dismiss(); });
this._elmts.resetButton.click(function() { this._elmts.resetButton.click(function() {
@ -98,10 +107,10 @@ TemplatingExporterDialog.prototype._scheduleUpdate = function() {
window.clearTimeout(this._timerID); window.clearTimeout(this._timerID);
} }
this._elmts.previewTextarea[0].value = "Idling..."; this._elmts.previewTextarea[0].value = $.i18n._('core-dialogs')["idling"];
this._timerID = window.setTimeout(function() { this._timerID = window.setTimeout(function() {
self._timerID = null; self._timerID = null;
self._elmts.previewTextarea[0].value = "Updating..."; self._elmts.previewTextarea[0].value = $.i18n._('core-dialogs')["updating"];
self._updatePreview(); self._updatePreview();
}, 1000); }, 1000);
}; };

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

@ -37,6 +37,23 @@ var Refine = {
actionAreas: [] actionAreas: []
}; };
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
},
success : function(data) {
dictionary = data;
}
});
$.i18n.setDictionary(dictionary);
// End internationalization
Refine.selectActionArea = function(id) { Refine.selectActionArea = function(id) {
$('.action-area-tab').removeClass('selected'); $('.action-area-tab').removeClass('selected');
$('.action-area-tab-body').css('visibility', 'hidden').css('z-index', '50'); $('.action-area-tab-body').css('visibility', 'hidden').css('z-index', '50');
@ -75,7 +92,7 @@ $(function() {
function(data) { function(data) {
OpenRefineVersion = data; OpenRefineVersion = data;
$("#openrefine-version").text("Version " + OpenRefineVersion.full_version); $("#openrefine-version").text($.i18n._('core-index')["version"]+" " + OpenRefineVersion.full_version);
var script = $('<script></script>') var script = $('<script></script>')
.attr("src", "http://google-refine.googlecode.com/svn/support/releases.js") .attr("src", "http://google-refine.googlecode.com/svn/support/releases.js")
@ -88,12 +105,12 @@ $(function() {
var container = $('<div id="notification-container">') var container = $('<div id="notification-container">')
.appendTo(document.body); .appendTo(document.body);
var notification = $('<div id="notification">') var notification = $('<div id="notification">')
.text('New version! ') .text($.i18n._('core-index')["new-version"]+' ')
.appendTo(container); .appendTo(container);
$('<a>') $('<a>')
.addClass('notification-action') .addClass('notification-action')
.attr("href", releases.homepage) .attr("href", releases.homepage)
.text('Download ' + releases.releases[0].description + ' now.') .text($.i18n._('core-index')["download"]+' ' + releases.releases[0].description + ' '+$.i18n._('core-index')["now"]+'.')
.appendTo(notification); .appendTo(notification);
} }
} else { } else {
@ -174,5 +191,12 @@ $(function() {
} }
Refine.selectActionArea('create-project'); Refine.selectActionArea('create-project');
$("#slogan").text($.i18n._('core-index')["slogan"]+".");
$("#or-index-help").text($.i18n._('core-index')["help"]);
$("#or-index-about").text($.i18n._('core-index')["about"]);
$("#or-index-noProj").text($.i18n._('core-index')["no-proj"]+".");
$("#or-index-try").text($.i18n._('core-index')["try-these"]);
$("#or-index-sample").text($.i18n._('core-index')["sample-data"]);
showVersion(); showVersion();
}); });

View File

@ -1,5 +1,5 @@
<div id="create-project-error-panel"><div class="grid-layout layout-normal layout-full"><table> <div id="create-project-error-panel"><div class="grid-layout layout-normal layout-full"><table>
<tr><td id="create-project-error-message"></td></tr> <tr><td id="create-project-error-message"></td></tr>
<tr><td id="create-project-error-stack"></td></tr> <tr><td id="create-project-error-stack"></td></tr>
<tr><td><button class="button button-primary" id="create-project-error-ok-button">OK</button></td></tr> <tr><td><button class="button button-primary" id="create-project-error-ok-button"></button></td></tr>
</table></div></div> </table></div></div>

View File

@ -5,7 +5,7 @@
<div id="create-project-progress-bar-frame"><div id="create-project-progress-bar-body"></div></div> <div id="create-project-progress-bar-frame"><div id="create-project-progress-bar-body"></div></div>
</td></tr> </td></tr>
<tr><td colspan="3"> <tr><td colspan="3">
<button class="button" id="create-project-progress-cancel-button">Cancel</button> <button class="button" id="create-project-progress-cancel-button"></button>
<span id="create-project-progress-timing"></span> <span id="create-project-progress-timing"></span>
<span id="create-project-progress-memory"></span> <span id="create-project-progress-memory"></span>
</td></tr> </td></tr>

View File

@ -1,16 +1,13 @@
<div id="create-project-ui-source-selection" class="relative-frame"><table id="create-project-ui-source-selection-layout"> <div id="create-project-ui-source-selection" class="relative-frame"><table id="create-project-ui-source-selection-layout">
<tr> <tr>
<td colspan="2" id="create-project-ui-source-selection-message"> <td colspan="2" id="create-project-ui-source-selection-message">
<h3>Create a project by importing data. What kinds of data files can I import?</h3> <h3 id="or-create-question"></h3>
<div>TSV, CSV, *SV, Excel (.xls and .xlsx), JSON, XML, RDF as XML, and <div id="or-create-formats"></div>
Google Data documents are all supported. Support for other formats can
be added with OpenRefine extensions.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id="create-project-ui-source-selection-tabs"> <td id="create-project-ui-source-selection-tabs">
<div>Get data from</div> <div id="or-create-from"></div>
</td> </td>
<td id="create-project-ui-source-selection-tab-bodies"></td> <td id="create-project-ui-source-selection-tab-bodies"></td>
</tr> </tr>

View File

@ -49,6 +49,13 @@ Refine.CreateProjectUI = function(elmt) {
this._errorPanel = this.addCustomPanel(); this._errorPanel = this.addCustomPanel();
this._errorPanel.html(DOM.loadHTML("core", "scripts/index/create-project-error-panel.html")); this._errorPanel.html(DOM.loadHTML("core", "scripts/index/create-project-error-panel.html"));
$('#or-create-question').text($.i18n._('core-index-create')["question"]);
$('#or-create-formats').text($.i18n._('core-index-create')["formats"]);
$('#or-create-from').text($.i18n._('core-index-create')["from"]);
$('#create-project-progress-cancel-button').text($.i18n._('core-buttons')["cancel"]);
$('#create-project-error-ok-button').text($.i18n._('core-buttons')["ok"]);
$.post( $.post(
"command/core/get-importing-configuration", "command/core/get-importing-configuration",
null, null,
@ -155,7 +162,7 @@ Refine.CreateProjectUI.prototype.showSourceSelectionPanel = function() {
Refine.actionAreas.push({ Refine.actionAreas.push({
id: "create-project", id: "create-project",
label: "Create Project", label: $.i18n._('core-index-create')["create-proj"],
uiClass: Refine.CreateProjectUI uiClass: Refine.CreateProjectUI
}); });
@ -166,7 +173,7 @@ Refine.CreateProjectUI.prototype.showImportProgressPanel = function(progressMess
$('#create-project-progress-message').text(progressMessage); $('#create-project-progress-message').text(progressMessage);
$('#create-project-progress-bar-body').css("width", "0%"); $('#create-project-progress-bar-body').css("width", "0%");
$('#create-project-progress-message-left').text('Starting'); $('#create-project-progress-message-left').text($.i18n._('core-index-create')["starting"]);
$('#create-project-progress-message-center').empty(); $('#create-project-progress-message-center').empty();
$('#create-project-progress-message-right').empty(); $('#create-project-progress-message-right').empty();
$('#create-project-progress-timing').empty(); $('#create-project-progress-timing').empty();
@ -196,7 +203,7 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID,
onError(job); onError(job);
} else if (checkDone(job)) { } else if (checkDone(job)) {
$('#create-project-progress-message').text('Done.'); $('#create-project-progress-message').text($.i18n._('core-index-create')["done"]);
window.clearInterval(timerID); window.clearInterval(timerID);
if (callback) { if (callback) {
@ -215,13 +222,13 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID,
if (secondsRemaining > 1) { if (secondsRemaining > 1) {
if (secondsRemaining > 60) { if (secondsRemaining > 60) {
$('#create-project-progress-timing').text( $('#create-project-progress-timing').text(
Math.ceil(secondsRemaining / 60) + " minutes remaining"); Math.ceil(secondsRemaining / 60) + " "+$.i18n._('core-index-create')["min-remaining"]);
} else { } else {
$('#create-project-progress-timing').text( $('#create-project-progress-timing').text(
Math.ceil(secondsRemaining) + " seconds remaining"); Math.ceil(secondsRemaining) + " "+$.i18n._('core-index-create')["sec-remaining"]);
} }
} else { } else {
$('#create-project-progress-timing').text('almost done ...'); $('#create-project-progress-timing').text($.i18n._('core-index-create')["almost-done"]);
} }
} else { } else {
$('#create-project-progress-bar-body').addClass('indefinite'); $('#create-project-progress-bar-body').addClass('indefinite');
@ -230,7 +237,7 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID,
$('#create-project-progress-message').text(progress.message); $('#create-project-progress-message').text(progress.message);
if ('memory' in progress) { if ('memory' in progress) {
var percent = progress.memory * 100.0 / progress.maxmemory; var percent = progress.memory * 100.0 / progress.maxmemory;
$('#create-project-progress-memory').text("Memory usage: "+percent.toFixed()+'% ('+progress.memory+'/'+progress.maxmemory+"MB)"); $('#create-project-progress-memory').text($.i18n._('core-index-create')["memory-usage"]+" "+percent.toFixed()+'% ('+progress.memory+'/'+progress.maxmemory+"MB)");
if (percent > 90) { if (percent > 90) {
$('#create-project-progress-memory').addClass('warning'); $('#create-project-progress-memory').addClass('warning');
} else { } else {
@ -247,7 +254,7 @@ Refine.CreateProjectUI.prototype.showImportJobError = function(message, stack) {
var self = this; var self = this;
$('#create-project-error-message').text(message); $('#create-project-error-message').text(message);
$('#create-project-error-stack').text(stack || 'No technical details.'); $('#create-project-error-stack').text(stack || $.i18n._('core-index-create')["no-details"]);
this.showCustomPanel(this._errorPanel); this.showCustomPanel(this._errorPanel);
$('#create-project-error-ok-button').unbind().click(function() { $('#create-project-error-ok-button').unbind().click(function() {

View File

@ -174,7 +174,7 @@ Refine.DefaultImportingController.prototype._prepareData = function() {
Refine.DefaultImportingController.prototype._ensureFormatParserUIHasInitializationData = function(format, onDone) { Refine.DefaultImportingController.prototype._ensureFormatParserUIHasInitializationData = function(format, onDone) {
if (!(format in this._parserOptions)) { if (!(format in this._parserOptions)) {
var self = this; var self = this;
var dismissBusy = DialogSystem.showBusy("Inspecting selected files ..."); var dismissBusy = DialogSystem.showBusy($.i18n._('core-index-import')["inspecting"]);
$.post( $.post(
"command/core/importing-controller?" + $.param({ "command/core/importing-controller?" + $.param({
"controller": "core/default-importing-controller", "controller": "core/default-importing-controller",
@ -263,7 +263,7 @@ Refine.DefaultImportingController.prototype._createProject = function() {
if ((this._formatParserUI) && this._formatParserUI.confirmReadyToCreateProject()) { if ((this._formatParserUI) && this._formatParserUI.confirmReadyToCreateProject()) {
var projectName = $.trim(this._parsingPanelElmts.projectNameInput[0].value); var projectName = $.trim(this._parsingPanelElmts.projectNameInput[0].value);
if (projectName.length === 0) { if (projectName.length === 0) {
window.alert("Please name the project."); window.alert($.i18n._('core-index-import')["warning-name"]);
this._parsingPanelElmts.projectNameInput.focus(); this._parsingPanelElmts.projectNameInput.focus();
return; return;
} }
@ -302,14 +302,14 @@ Refine.DefaultImportingController.prototype._createProject = function() {
document.location = "project?project=" + job.config.projectID; document.location = "project?project=" + job.config.projectID;
}, },
function(job) { function(job) {
alert('Errors:\n' + Refine.CreateProjectUI.composeErrorMessage(job)); alert($.i18n._('core-index-import')["errors"]+'\n' + Refine.CreateProjectUI.composeErrorMessage(job));
self._onImportJobReady(); self._onImportJobReady();
} }
); );
}, },
1000 1000
); );
self._createProjectUI.showImportProgressPanel("Creating project ...", function() { self._createProjectUI.showImportProgressPanel($.i18n._('core-index-import')["creating-proj"], function() {
// stop the timed polling // stop the timed polling
window.clearInterval(timerID); window.clearInterval(timerID);

View File

@ -1,34 +1,31 @@
<div bind="wizardHeader" class="default-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr> <div bind="wizardHeader" class="default-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr>
<td width="1%"><button bind="startOverButton" class="button">&laquo; Start Over</button></td> <td width="1%"><button bind="startOverButton" class="button"></button></td>
<td width="98%">Select Files to Import</td> <td width="98%" id="or-import-select"></td>
<td width="1%"><button bind="nextButton" class="button button-primary">Configure Parsing Options &raquo;</button></td> <td width="1%"><button bind="nextButton" class="button button-primary"></button></td>
</tr></table></div></div> </tr></table></div></div>
<div bind="controlPanel" class="default-importing-file-selection-control-panel"> <div bind="controlPanel" class="default-importing-file-selection-control-panel">
<div class="grid-layout layout-full layout-tighter"><table> <div class="grid-layout layout-full layout-tighter"><table>
<tr> <tr>
<td colspan="3"> <td colspan="3" id="or-import-severalFile"></td>
There are several files available.
Please select the ones to import.
</td>
</tr> </tr>
<tr> <tr>
<td width="98%" bind="summary"></td> <td width="98%" bind="summary"></td>
<td width="1%"><button bind="selectAllButton" class="button">Select All</button></td> <td width="1%"><button bind="selectAllButton" class="button"></button></td>
<td width="1%"><button bind="unselectAllButton" class="button">Unselect All</button></td> <td width="1%"><button bind="unselectAllButton" class="button"></button></td>
</tr> </tr>
</table></div> </table></div>
<h2>Select by Extension</h2> <h2 id="or-import-selExt"></h2>
<div bind="extensionContainer" class="grid-layout layout-full layout-tightest"></div> <div bind="extensionContainer" class="grid-layout layout-full layout-tightest"></div>
<h2>Select by Regex on File Names</h2> <h2 id="or-import-regex"></h2>
<div class="grid-layout layout-full layout-tighter"><table> <div class="grid-layout layout-full layout-tighter"><table>
<tr><td colspan="3"><input bind="regexInput" style="width: 100%;"/></td></tr> <tr><td colspan="3"><input bind="regexInput" style="width: 100%;"/></td></tr>
<tr> <tr>
<td bind="regexSummary"></td> <td bind="regexSummary"></td>
<td width="1%"><button bind="selectRegexButton" class="button">Select</button></td> <td width="1%"><button bind="selectRegexButton" class="button"></button></td>
<td width="1%"><button bind="unselectRegexButton" class="button">Unselect</button></td> <td width="1%"><button bind="unselectRegexButton" class="button"></button></td>
</tr> </tr>
</table></div> </table></div>
</div> </div>

View File

@ -58,6 +58,19 @@ Refine.DefaultImportingController.prototype._prepareFileSelectionPanel = functio
DOM.loadHTML("core", "scripts/index/default-importing-controller/file-selection-panel.html")); DOM.loadHTML("core", "scripts/index/default-importing-controller/file-selection-panel.html"));
this._fileSelectionPanelElmts = DOM.bind(this._fileSelectionPanel); this._fileSelectionPanelElmts = DOM.bind(this._fileSelectionPanel);
$('#or-import-select').text($.i18n._('core-index-import')["select-file"]);
$('#or-import-severalFile').text($.i18n._('core-index-import')["several-file"]);
$('#or-import-selExt').text($.i18n._('core-index-import')["sel-by-extension"]);
$('#or-import-regex').text($.i18n._('core-index-import')["sel-by-regex"]);
this._fileSelectionPanelElmts.startOverButton.html($.i18n._('core-buttons')["startover"]);
this._fileSelectionPanelElmts.nextButton.html($.i18n._('core-buttons')["conf-pars-opt"]);
this._fileSelectionPanelElmts.selectAllButton.text($.i18n._('core-buttons')["select-all"]);
this._fileSelectionPanelElmts.unselectAllButton.text($.i18n._('core-buttons')["unselect-all"]);
this._fileSelectionPanelElmts.selectRegexButton.text($.i18n._('core-buttons')["select"]);
this._fileSelectionPanelElmts.unselectRegexButton.text($.i18n._('core-buttons')["unselect"]);
this._fileSelectionPanelElmts.startOverButton.click(function() { this._fileSelectionPanelElmts.startOverButton.click(function() {
self._startOver(); self._startOver();
}); });
@ -97,7 +110,7 @@ Refine.DefaultImportingController.prototype._renderFileSelectionPanelFileTable =
this._fileSelectionPanelElmts.filePanel.empty(); this._fileSelectionPanelElmts.filePanel.empty();
var fileTable = $('<table><tr><th>Import?</th><th>Name</th><th>Mime-type</th><th>Format</th><th>Size</th></tr></table>') var fileTable = $('<table><tr><th>'+$.i18n._('core-index-import')["import"]+'</th><th>'+$.i18n._('core-index-import')["name"]+'</th><th>'+$.i18n._('core-index-import')["mime-type"]+'</th><th>'+$.i18n._('core-index-import')["format"]+'</th><th>'+$.i18n._('core-index-import')["size"]+'</th></tr></table>')
.appendTo(this._fileSelectionPanelElmts.filePanel)[0]; .appendTo(this._fileSelectionPanelElmts.filePanel)[0];
var round = function(n) { var round = function(n) {
@ -189,7 +202,7 @@ Refine.DefaultImportingController.prototype._renderFileSelectionPanelControlPane
$('<td>').text(extension.extension).appendTo(tr); $('<td>').text(extension.extension).appendTo(tr);
$('<td>').text(extension.count + (extension.count > 1 ? " files" : " file")).appendTo(tr); $('<td>').text(extension.count + (extension.count > 1 ? " files" : " file")).appendTo(tr);
$('<button>') $('<button>')
.text("Select") .text($.i18n._('core-buttons')["select"])
.addClass("button") .addClass("button")
.appendTo($('<td>').appendTo(tr)) .appendTo($('<td>').appendTo(tr))
.click(function() { .click(function() {
@ -207,7 +220,7 @@ Refine.DefaultImportingController.prototype._renderFileSelectionPanelControlPane
self._updateFileSelectionSummary(); self._updateFileSelectionSummary();
}); });
$('<button>') $('<button>')
.text("Unselect") .text($.i18n._('core-buttons')["unselect"])
.addClass("button") .addClass("button")
.appendTo($('<td>').appendTo(tr)) .appendTo($('<td>').appendTo(tr))
.click(function() { .click(function() {
@ -309,12 +322,12 @@ Refine.DefaultImportingController.prototype._updateFileSelectionSummary = functi
Refine.DefaultImportingController.prototype._commitFileSelection = function() { Refine.DefaultImportingController.prototype._commitFileSelection = function() {
if (this._job.config.fileSelection.length === 0) { if (this._job.config.fileSelection.length === 0) {
alert("Please select at least one file."); alert();
return; return;
} }
var self = this; var self = this;
var dismissBusy = DialogSystem.showBusy("Inspecting<br/>selected files ..."); var dismissBusy = DialogSystem.showBusy($.i18n._('core-index-import')["inspecting-files"]);
$.post( $.post(
"command/core/importing-controller?" + $.param({ "command/core/importing-controller?" + $.param({
"controller": "core/default-importing-controller", "controller": "core/default-importing-controller",
@ -328,9 +341,9 @@ Refine.DefaultImportingController.prototype._commitFileSelection = function() {
dismissBusy(); dismissBusy();
if (!(data)) { if (!(data)) {
self._createProjectUI.showImportJobError("Unknown error"); self._createProjectUI.showImportJobError($.i18n._('core-index-import')["unknown-err"]);
} else if (data.code == "error" || !("job" in data)) { } else if (data.code == "error" || !("job" in data)) {
self._createProjectUI.showImportJobError((data.message) ? ("Error: " + data.message) : "Unknown error"); self._createProjectUI.showImportJobError((data.message) ? ($.i18n._('core-index-import')["error"]+ ' ' + data.message) : $.i18n._('core-index-import')["unknown-err"]);
} else { } else {
// Different files might be selected. We start over again. // Different files might be selected. We start over again.
delete this._parserOptions; delete this._parserOptions;

View File

@ -1,20 +1,20 @@
<div bind="wizardHeader" class="default-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr> <div bind="wizardHeader" class="default-importing-wizard-header"><div class="grid-layout layout-tightest layout-full"><table><tr>
<td width="1%"><button bind="startOverButton" class="button">&laquo; Start Over</button></td> <td width="1%"><button bind="startOverButton" class="button"></button></td>
<td width="1%"><button bind="previousButton" class="button">&laquo; Re-select Files</button></td> <td width="1%"><button bind="previousButton" class="button"></button></td>
<td width="98%">Configure Parsing Options</td> <td width="98%" id="or-import-parsopt"></td>
<td style="text-align: right;">Project&nbsp;name</td> <td style="text-align: right;" id="or-import-projname"></td>
<td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td> <td width="1%"><input class="inline" type="text" size="30" bind="projectNameInput" /></td>
<td width="1%"><button bind="nextButton" class="button button-primary">Create Project &raquo;</button></td> <td width="1%"><button bind="nextButton" class="button button-primary"></button></td>
</tr></table></div></div> </tr></table></div></div>
<div bind="dataPanel" class="default-importing-parsing-data-panel"></div> <div bind="dataPanel" class="default-importing-parsing-data-panel"></div>
<div bind="progressPanel" class="default-importing-progress-data-panel"> <div bind="progressPanel" class="default-importing-progress-data-panel">
<img src="images/large-spinner.gif" /> Updating preview ... <img src="images/large-spinner.gif" /> <span id="or-import-updating"></span>
</div> </div>
<div bind="controlPanel" class="default-importing-parsing-control-panel"><table><tr> <div bind="controlPanel" class="default-importing-parsing-control-panel"><table><tr>
<td class="default-importing-parsing-control-panel-formats"> <td class="default-importing-parsing-control-panel-formats">
<div class="default-importing-parsing-control-panel-formats-message">Parse data as</div> <div class="default-importing-parsing-control-panel-formats-message" id="or-import-parseas"></div>
<div bind="formatsContainer"></div> <div bind="formatsContainer"></div>
</td> </td>
<td bind="optionsContainer" class="default-importing-parsing-control-panel-options-panel"></td> <td bind="optionsContainer" class="default-importing-parsing-control-panel-options-panel"></td>

View File

@ -92,6 +92,13 @@ Refine.DefaultImportingController.prototype._prepareParsingPanel = function() {
}); });
this._parsingPanelElmts.progressPanel.hide(); this._parsingPanelElmts.progressPanel.hide();
this._parsingPanelElmts.startOverButton.html($.i18n._('core-buttons')["startover"]);
this._parsingPanelElmts.nextButton.html($.i18n._('core-buttons')["create-project"]);
$('#or-import-parsopt').text($.i18n._('core-index-import')["parsing-options"]);
$('#or-import-projname').html($.i18n._('core-index-import')["project-name"]);
$('#or-import-updating').text($.i18n._('core-index-import')["updating-preview"]);
$('#or-import-parseas').text($.i18n._('core-index-import')["parse-as"]);
this._parsingPanelResizer = function() { this._parsingPanelResizer = function() {
var elmts = self._parsingPanelElmts; var elmts = self._parsingPanelElmts;
var width = self._parsingPanel.width(); var width = self._parsingPanel.width();

View File

@ -1,6 +1,6 @@
<form bind="form"><div class="grid-layout layout-normal"><table> <form bind="form"><div class="grid-layout layout-normal"><table>
<tr><td>Paste data from clipboard here:</td></tr> <tr><td id="or-import-clipboard"></td></tr>
<tr><td><textarea bind="textInput" name="clipboard" id="default-importing-clipboard-textarea"></textarea> <tr><td><textarea bind="textInput" name="clipboard" id="default-importing-clipboard-textarea"></textarea>
</td></tr> </td></tr>
<tr><td><button bind="nextButton" class="button button-primary" type="button">Next &raquo;</button></td></tr> <tr><td><button bind="nextButton" class="button button-primary" type="button"></button></td></tr>
</table></div></form> </table></div></form>

View File

@ -1,5 +1,5 @@
<form bind="form"><div class="grid-layout layout-normal"><table> <form bind="form"><div class="grid-layout layout-normal"><table>
<tr><td>Locate one or more files on your computer to upload:</td></tr> <tr><td id="or-import-locate"></td></tr>
<tr><td><input type="file" multiple bind="fileInput" name="upload" /></td></tr> <tr><td><input type="file" multiple bind="fileInput" name="upload" /></td></tr>
<tr><td><button bind="nextButton" class="button button-primary" type="button">Next &raquo;</button></td></tr> <tr><td><button bind="nextButton" class="button button-primary" type="button"></button></td></tr>
</table></div></form> </table></div></form>

View File

@ -1,8 +1,8 @@
<form bind="form"><div class="grid-layout layout-normal"><table> <form bind="form"><div class="grid-layout layout-normal"><table>
<tr><td colspan="2">Enter one or more web addresses (URLs) pointing to data to download:</td></tr> <tr><td colspan="2" id="or-import-enterurl"></td></tr>
<tr bind="urlRow"><td colspan="2"><input bind="urlInput" name="download" class="default-importing-web-url" /></td></tr> <tr bind="urlRow"><td colspan="2"><input bind="urlInput" name="download" class="default-importing-web-url" /></td></tr>
<tr bind="buttons"> <tr bind="buttons">
<td width="1"><button bind="addButton" class="button" type="button">Add Another URL</button></td> <td width="1"><button bind="addButton" class="button" type="button"></button></td>
<td><button bind="nextButton" class="button button-primary" type="button">Next &raquo;</button></td> <td><button bind="nextButton" class="button button-primary" type="button"></button></td>
</tr> </tr>
</table></div></form> </table></div></form>

View File

@ -35,7 +35,7 @@ function ThisComputerImportingSourceUI(controller) {
this._controller = controller; this._controller = controller;
} }
Refine.DefaultImportingController.sources.push({ Refine.DefaultImportingController.sources.push({
"label": "This Computer", "label": $.i18n._('core-index-import')["this-computer"],
"id": "upload", "id": "upload",
"uiClass": ThisComputerImportingSourceUI "uiClass": ThisComputerImportingSourceUI
}); });
@ -46,11 +46,16 @@ ThisComputerImportingSourceUI.prototype.attachUI = function(bodyDiv) {
bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-computer-form.html")); bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-computer-form.html"));
this._elmts = DOM.bind(bodyDiv); this._elmts = DOM.bind(bodyDiv);
$('#or-import-locate').text($.i18n._('core-index-import')["locate-files"]);
$('#or-import-locate').text($.i18n._('core-index-import')["locate-files"]);
this._elmts.nextButton.html($.i18n._('core-buttons')["next"]);
this._elmts.nextButton.click(function(evt) { this._elmts.nextButton.click(function(evt) {
if (self._elmts.fileInput[0].files.length === 0) { if (self._elmts.fileInput[0].files.length === 0) {
window.alert("You must specify a data file to import."); window.alert($.i18n._('core-index-import')["warning-data-file"]);
} else { } else {
self._controller.startImportJob(self._elmts.form, "Uploading data ..."); self._controller.startImportJob(self._elmts.form, $.i18n._('core-index-import')["uploading-data"]);
} }
}); });
}; };
@ -62,7 +67,7 @@ function UrlImportingSourceUI(controller) {
this._controller = controller; this._controller = controller;
} }
Refine.DefaultImportingController.sources.push({ Refine.DefaultImportingController.sources.push({
"label": "Web Addresses (URLs)", "label": $.i18n._('core-index-import')["web-address"],
"id": "download", "id": "download",
"uiClass": UrlImportingSourceUI "uiClass": UrlImportingSourceUI
}); });
@ -73,11 +78,16 @@ UrlImportingSourceUI.prototype.attachUI = function(bodyDiv) {
bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-web-form.html")); bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-web-form.html"));
this._elmts = DOM.bind(bodyDiv); this._elmts = DOM.bind(bodyDiv);
$('#or-import-enterurl').text($.i18n._('core-index-import')["enter-url"]);
this._elmts.addButton.html($.i18n._('core-buttons')["add-url"]);
this._elmts.nextButton.html($.i18n._('core-buttons')["next"]);
this._elmts.nextButton.click(function(evt) { this._elmts.nextButton.click(function(evt) {
if ($.trim(self._elmts.urlInput[0].value).length === 0) { if ($.trim(self._elmts.urlInput[0].value).length === 0) {
window.alert("You must specify a web address (URL) to import."); window.alert($.i18n._('core-index-import')["warning-web-address"]);
} else { } else {
self._controller.startImportJob(self._elmts.form, "Downloading data ..."); self._controller.startImportJob(self._elmts.form, $.i18n._('core-index-import')["downloading-data"]);
} }
}); });
this._elmts.addButton.click(function(evt) { this._elmts.addButton.click(function(evt) {
@ -93,7 +103,7 @@ function ClipboardImportingSourceUI(controller) {
this._controller = controller; this._controller = controller;
} }
Refine.DefaultImportingController.sources.push({ Refine.DefaultImportingController.sources.push({
"label": "Clipboard", "label": $.i18n._('core-index-import')["clipboard"],
"id": "clipboard", "id": "clipboard",
"uiClass": ClipboardImportingSourceUI "uiClass": ClipboardImportingSourceUI
}); });
@ -104,11 +114,15 @@ ClipboardImportingSourceUI.prototype.attachUI = function(bodyDiv) {
bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-clipboard-form.html")); bodyDiv.html(DOM.loadHTML("core", "scripts/index/default-importing-sources/import-from-clipboard-form.html"));
this._elmts = DOM.bind(bodyDiv); this._elmts = DOM.bind(bodyDiv);
$('#or-import-clipboard').text($.i18n._('core-index-import')["clipboard-label"]);
this._elmts.nextButton.html($.i18n._('core-buttons')["next"]);
this._elmts.nextButton.click(function(evt) { this._elmts.nextButton.click(function(evt) {
if ($.trim(self._elmts.textInput[0].value).length === 0) { if ($.trim(self._elmts.textInput[0].value).length === 0) {
window.alert("You must paste some data to import."); window.alert($.i18n._('core-index-import')["warning-clipboard"]);
} else { } else {
self._controller.startImportJob(self._elmts.form, "Uploading pasted data ..."); self._controller.startImportJob(self._elmts.form, $.i18n._('core-index-import')["uploading-pasted-data"]);
} }
}); });
}; };

View File

@ -1,17 +1,17 @@
<form id="project-upload-form" method="post" enctype="multipart/form-data" action="command/core/import-project" accept-charset="UTF-8"> <form id="project-upload-form" method="post" enctype="multipart/form-data" action="command/core/import-project" accept-charset="UTF-8">
<div class="grid-layout layout-normal"><table> <div class="grid-layout layout-normal"><table>
<tr> <tr>
<td colspan="2">Locate an existing Refine project file (.tar or .tar.gz):</td> <td colspan="2" id="or-import-locate"></td>
<tr> <tr>
<td>Project file:</th> <td id="or-import-file"></th>
<td><input type="file" id="project-tar-file-input" name="project-file" /></td> <td><input type="file" id="project-tar-file-input" name="project-file" /></td>
</tr> </tr>
<tr> <tr>
<td>Re-name project (optional):</th> <td id="or-import-rename"></th>
<td><input type="text" size="25" id="project-name-input" name="project-name" /></td></tr> <td><input type="text" size="25" id="project-name-input" name="project-name" /></td></tr>
<tr> <tr>
<td></td> <td></td>
<td><input type="submit" value="Import Project" id="import-project-button" class="button button-primary" /></td> <td><input type="submit" id="import-project-button" class="button button-primary" /></td>
</tr> </tr>
</table></div> </table></div>
</form> </form>

View File

@ -36,11 +36,16 @@ Refine.ImportProjectUI = function(elmt) {
this._elmt = elmt; this._elmt = elmt;
this._elmts = DOM.bind(elmt); this._elmts = DOM.bind(elmt);
$('#or-import-locate').text($.i18n._('core-index-import')["locate"]);
$('#or-import-file').text($.i18n._('core-index-import')["file"]);
$('#or-import-rename').text($.i18n._('core-index-import')["rename"]);
$('#import-project-button').attr("value",$.i18n._('core-buttons')["import-proj"]);
}; };
Refine.actionAreas.push({ Refine.actionAreas.push({
id: "import-project", id: "import-project",
label: "Import Project", label: $.i18n._('core-index-import')["import-proj"],
uiClass: Refine.ImportProjectUI uiClass: Refine.ImportProjectUI
}); });

View File

@ -0,0 +1,21 @@
<div class="grid-layout layout-normal" id="project-upload-form">
<table>
<tr>
<td colspan="2" bind="or_lang_label"></td>
</tr>
<tr></tr>
<tr>
<td></td>
<td><select id="langDD">
<option value="en" selected>English</option>
<option value="it">Italian</option>
</select></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="set-lang-button" bind="set_lan_btn"
class="button button-primary" /></td>
</tr>
</table>
</div>

View File

@ -0,0 +1,35 @@
Refine.SetLanguageUI = function(elmt) {
var self = this;
elmt.html(DOM.loadHTML("core", "scripts/index/lang-settings-ui.html"));
this._elmt = elmt;
this._elmts = DOM.bind(elmt);
this._elmts.or_lang_label.text($.i18n._('core-index-lang')["label"]+":");
this._elmts.set_lan_btn.attr("value", $.i18n._('core-index-lang')["send-req"]);
this._elmts.set_lan_btn.bind('click', function(e) {
$.ajax({
url : "/command/core/set-language?",
type : "POST",
async : false,
data : {
lng : $("#langDD option:selected").val()
},
success : function(data) {
alert($.i18n._('core-index-lang')["page-reload"]);
location.reload(true);
}
});
});
};
Refine.SetLanguageUI.prototype.resize = function() {
};
Refine.actionAreas.push({
id : "lang-settings",
label : $.i18n._('core-index-lang')["lang-settings"],
uiClass : Refine.SetLanguageUI
});

View File

@ -1,4 +1,4 @@
<div class="relative-frame"> <div class="relative-frame">
<div bind="projectsContainer" id="projects-container"></div> <div bind="projectsContainer" id="projects-container"></div>
<div bind="workspaceControls" id="projects-workspace-controls"><a id="projects-workspace-open" href="javascript:{}" class="secondary">Browse workspace directory</a></div> <div bind="workspaceControls" id="projects-workspace-controls"><a id="projects-workspace-open" href="javascript:{}" class="secondary"></a></div>
</div> </div>

View File

@ -57,6 +57,7 @@ Refine.OpenProjectUI = function(elmt) {
return self._onClickUploadFileButton(evt); return self._onClickUploadFileButton(evt);
}); });
$('#projects-workspace-open').text($.i18n._('core-index-open')["browse"]);
$('#projects-workspace-open').click(function() { $('#projects-workspace-open').click(function() {
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -122,8 +123,8 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
'<table class="list-table"><tr>' + '<table class="list-table"><tr>' +
'<th></th>' + '<th></th>' +
'<th></th>' + '<th></th>' +
'<th>Last&nbsp;modified</th>' + '<th>'+$.i18n._('core-index-open')["last-mod"]+'</th>' +
'<th>Name</th>' + '<th>'+$.i18n._('core-index-open')["name"]+'</th>' +
'</tr></table>' '</tr></table>'
).appendTo(container)[0]; ).appendTo(container)[0];
@ -133,12 +134,12 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
var deleteLink = $('<a></a>') var deleteLink = $('<a></a>')
.addClass("delete-project") .addClass("delete-project")
.attr("title","Delete this project") .attr("title",$.i18n._('core-index-open')["del-title"])
.attr("href","") .attr("href","")
.css("visibility", "hidden") .css("visibility", "hidden")
.html("<img src='images/close.png' />") .html("<img src='images/close.png' />")
.click(function() { .click(function() {
if (window.confirm("Are you sure you want to delete project \"" + project.name + "\"?")) { if (window.confirm($.i18n._('core-index-open')["del-body"] + project.name + "\"?")) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "command/core/delete-project", url: "command/core/delete-project",
@ -157,12 +158,12 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
); );
var renameLink = $('<a></a>') var renameLink = $('<a></a>')
.text("rename") .text($.i18n._('core-index-open')["rename"])
.addClass("secondary") .addClass("secondary")
.attr("href", "javascript:{}") .attr("href", "javascript:{}")
.css("visibility", "hidden") .css("visibility", "hidden")
.click(function() { .click(function() {
var name = window.prompt("New project name:", project.name); var name = window.prompt($.i18n._('core-index-open')["new-title"], project.name);
if (name === null) { if (name === null) {
return; return;
} }
@ -181,7 +182,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
if (data && typeof data.code != 'undefined' && data.code == "ok") { if (data && typeof data.code != 'undefined' && data.code == "ok") {
nameLink.text(name); nameLink.text(name);
} else { } else {
alert("Failed to rename project: " + data.message); alert($.i18n._('core-index-open')["warning-rename"]+" " + data.message);
} }
} }
}); });
@ -220,10 +221,10 @@ Refine.OpenProjectUI.prototype._onClickUploadFileButton = function(evt) {
var projectName = $("#project-name-input")[0].value; var projectName = $("#project-name-input")[0].value;
var dataURL = $.trim($("#project-url-input")[0].value); var dataURL = $.trim($("#project-url-input")[0].value);
if (! $.trim(projectName).length) { if (! $.trim(projectName).length) {
window.alert("You must specify a project name."); window.alert($.i18n._('core-index-open')["warning-proj-name"]);
} else if ($("#project-file-input")[0].files.length === 0 && ! dataURL.length) { } else if ($("#project-file-input")[0].files.length === 0 && ! dataURL.length) {
window.alert("You must specify a data file to upload or a URL to retrieve."); window.alert($.i18n._('core-index-open')["warning-data-file"]);
} else { } else {
$("#file-upload-form").attr("action", $("#file-upload-form").attr("action",
@ -248,6 +249,6 @@ Refine.OpenProjectUI.prototype._onClickUploadFileButton = function(evt) {
Refine.actionAreas.push({ Refine.actionAreas.push({
id: "open-project", id: "open-project",
label: "Open Project", label: $.i18n._('core-index-open')["open-proj"],
uiClass: Refine.OpenProjectUI uiClass: Refine.OpenProjectUI
}); });

View File

@ -4,42 +4,42 @@
<td><div class="grid-layout layout-tighter layout-full"><table> <td><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer"> <td><div class="grid-layout layout-tightest"><table bind="sheetRecordContainer">
<tr><td colspan="3">Worksheets to Import</td></tr> <tr><td colspan="3" id="or-import-worksheet"></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr> <tr>
<td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td> <td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
<td><label for="$ignore">Ignore first</label></td> <td><label for="$ignore" id="or-import-ignore"></label></td>
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
<label for="$ignore">line(s) at beginning of file</label></td></tr> <label for="$ignore" id="or-import-lines"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td> <tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
<td><label for="$headers">Parse next</label></td> <td><label for="$headers" id="or-import-parse"></label></td>
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> <td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
<label for="$headers">line(s) as column headers</label></td></tr> <label for="$headers" id="or-import-header"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" id="or-import-discard"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" id="or-import-rows2"></label></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" id="or-import-blank"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" id="or-import-null"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr> <td><label for="$include-file-sources" id="or-import-source"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -119,6 +119,20 @@ Refine.ExcelParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-worksheet').text($.i18n._('core-index-import')["import-worksheet"]);
$('#or-import-ignore').text($.i18n._('core-index-parser')["ignore-first"]);
$('#or-import-lines').text($.i18n._('core-index-parser')["lines-beg"]);
$('#or-import-parse').text($.i18n._('core-index-parser')["parse-next"]);
$('#or-import-header').text($.i18n._('core-index-parser')["lines-header"]);
$('#or-import-discard').text($.i18n._('core-index-parser')["discard-initial"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-rows2').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-blank').text($.i18n._('core-index-parser')["store-blank"]);
$('#or-import-null').text($.i18n._('core-index-parser')["store-nulls"]);
$('#or-import-source').html($.i18n._('core-index-parser')["store-source"]);
var sheetTable = this._optionContainerElmts.sheetRecordContainer[0]; var sheetTable = this._optionContainerElmts.sheetRecordContainer[0];
$.each(this._config.sheetRecords, function(i, v) { $.each(this._config.sheetRecords, function(i, v) {
var id = 'core-excel-worksheet-' + Math.round(Math.random() * 1000000); var id = 'core-excel-worksheet-' + Math.round(Math.random() * 1000000);

View File

@ -2,52 +2,52 @@
<tr> <tr>
<td><div class="grid-layout layout-tighter"><table> <td><div class="grid-layout layout-tighter"><table>
<tr> <tr>
<td width="1%">Character&nbsp;encoding</td> <td width="1%" id="or-import-encoding"></td>
<td><input bind="encodingInput"></input></td> <td><input bind="encodingInput"></input></td>
</tr> </tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tighter layout-full"><table> <td><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><div class="grid-layout layout-tightest"><table> <td colspan="2"><div class="grid-layout layout-tightest"><table>
<tr><td>Column widths:</td><td><input style="width: 40em;" bind="columnWidthsInput" /></td><td>comma separated numbers</td></tr> <tr><td id="or-import-columnWidth"></td><td><input style="width: 40em;" bind="columnWidthsInput" /></td><td id="or-import-comma"></td></tr>
<tr><td>Column names:</td><td><input style="width: 40em;" bind="columnNamesInput" /></td><td>optional, comma separated</td></tr> <tr><td id="or-import-columnNames"></td><td><input style="width: 40em;" bind="columnNamesInput" /></td><td id="or-import-optional"></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td> <tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
<td><label for="$ignore">Ignore first</label></td> <td><label for="$ignore" id="or-import-ignore"></label></td>
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
<label for="$ignore">line(s) at beginning of file</label></td></tr> <label for="$ignore" id="or-import-lines"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td> <tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
<td><label for="$headers">Parse next</label></td> <td><label for="$headers" id="or-import-parse"></label></td>
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> <td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
<label for="$headers">line(s) as column headers</label></td></tr> <label for="$headers" id="or-import-header"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" id="or-import-discard"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" id="or-import-rows2"></label></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td> <tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr> <td><label for="$guess" id="or-import-parseCell"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" id="or-import-blank"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" id="or-import-null"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr> <td><label for="$include-file-sources" id="or-import-source"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -121,6 +121,26 @@ Refine.FixedWidthParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self.updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self.updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-encoding').html($.i18n._('core-index-import')["char-encoding"]);
$('#or-import-columnWidth').text($.i18n._('core-index-import')["column-widths"]);
$('#or-import-columnNames').text($.i18n._('core-index-import')["column-names"]);
$('#or-import-comma').text($.i18n._('core-index-import')["comma-separated"]);
$('#or-import-optional').text($.i18n._('core-index-import')["optional-separated"]);
$('#or-import-ignore').text($.i18n._('core-index-parser')["ignore-first"]);
$('#or-import-lines').text($.i18n._('core-index-parser')["lines-beg"]);
$('#or-import-parse').text($.i18n._('core-index-parser')["parse-next"]);
$('#or-import-header').text($.i18n._('core-index-parser')["lines-header"]);
$('#or-import-discard').text($.i18n._('core-index-parser')["discard-initial"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-rows2').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-parseCell').html($.i18n._('core-index-parser')["parse-cell"]);
$('#or-import-blank').text($.i18n._('core-index-parser')["store-blank"]);
$('#or-import-null').text($.i18n._('core-index-parser')["store-nulls"]);
$('#or-import-source').html($.i18n._('core-index-parser')["store-source"]);
this._optionContainerElmts.encodingInput this._optionContainerElmts.encodingInput
.attr('value', this._config.encoding || '') .attr('value', this._config.encoding || '')
.click(function() { .click(function() {

View File

@ -1,4 +1,2 @@
<div class="json-parser-ui-select-message"> <div class="json-parser-ui-select-message" id="or-import-jsonParser"></div>
Click on the first JSON { } node corresponding to the first record to load.
</div>
<div class="json-parser-ui-select-dom" bind="domContainer"></div> <div class="json-parser-ui-select-dom" bind="domContainer"></div>

View File

@ -3,25 +3,25 @@
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="pickRecordElementsButton">Pick Record Nodes</button></td> <td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td>
<td width="1%"><button class="button" bind="previewButton">Update Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">record(s) of data</label></td></tr> <label for="$limit" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeEmptyStringsCheckbox" id="$store-empty-strings" value=true/></td> <tr><td width="1%"><input type="checkbox" bind="storeEmptyStringsCheckbox" id="$store-empty-strings" value=true/></td>
<td colspan="2"><label for="$store-empty-strings">Preserve empty strings</label></td></tr> <td colspan="2"><label for="$store-empty-strings" id="or-import-preserve"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="trimStringsCheckbox" id="$trim" /></td> <tr><td width="1%"><input type="checkbox" bind="trimStringsCheckbox" id="$trim" /></td>
<td><label for="$guess">Trim leading &amp; trailing whitespace from strings</label></td></tr> <td><label for="$guess" id="or-import-trim"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td> <tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr> <td><label for="$guess" id="or-import-parseCell"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td colspan="2"><label for="$include-file-sources">Store file source (file names, URLs) in each row</label></td></tr> <td colspan="2"><label for="$include-file-sources" id="or-import-source"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -61,7 +61,7 @@ Refine.JsonParserUI.prototype.confirmReadyToCreateProject = function() {
if ((this._config.recordPath) && this._config.recordPath.length > 0) { if ((this._config.recordPath) && this._config.recordPath.length > 0) {
return true; return true;
} else { } else {
window.alert('Please specify a record path first.'); window.alert($.i18n._('core-index-import')["warning-record-path"]);
} }
}; };
@ -104,6 +104,16 @@ Refine.JsonParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.pickRecordElementsButton.text($.i18n._('core-index-import')["warning-record-path"]);
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-preserve').text($.i18n._('core-index-parser')["preserve-empty"]);
$('#or-import-trim').html($.i18n._('core-index-parser')["trim"]);
$('#or-import-parseCell').html($.i18n._('core-index-parser')["parse-cell"]);
$('#or-import-source').html($.i18n._('core-index-parser')["store-source"]);
$('#or-import-jsonParser').text($.i18n._('core-index-parser')["json-parser"]);
if (this._config.limit > 0) { if (this._config.limit > 0) {
this._optionContainerElmts.limitCheckbox.attr("checked", "checked"); this._optionContainerElmts.limitCheckbox.attr("checked", "checked");
this._optionContainerElmts.limitInput[0].value = this._config.limit.toString(); this._optionContainerElmts.limitInput[0].value = this._config.limit.toString();

View File

@ -2,44 +2,44 @@
<tr> <tr>
<td><div class="grid-layout layout-tighter"><table> <td><div class="grid-layout layout-tighter"><table>
<tr> <tr>
<td width="1%">Character&nbsp;encoding</td> <td width="1%" id="or-import-encoding"></td>
<td><input bind="encodingInput"></input></td> <td><input bind="encodingInput"></input></td>
</tr> </tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tighter layout-full"><table> <td><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td colspan="2">Parse every <input bind="linesPerRowInput" type="text" class="lightweight" size="2" value="0" /> <tr><td colspan="2"><span id="or-import-parseEvery"></span> <input bind="linesPerRowInput" type="text" class="lightweight" size="2" value="0" />
lines into one row <span id="or-impor-linesIntoRow"></span>
</td></tr> </td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" id="or-import-blank"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" id="or-import-null"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr> <td><label for="$include-file-sources" id="or-import-source"></label></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td> <tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
<td><label for="$ignore">Ignore first</label></td> <td><label for="$ignore" id="or-import-ignore"></label></td>
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
<label for="$ignore">line(s) at beginning of file</label></td></tr> <label for="$ignore" id="or-import-lines"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" id="or-import-discard"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" id="or-import-rows2"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -110,6 +110,22 @@ Refine.LineBasedParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
$('#or-import-encoding').html($.i18n._('core-index-import')["char-encoding"]);
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-parseEvery').html($.i18n._('core-index-parser')["parse-every"]);
$('#or-impor-linesIntoRow').html($.i18n._('core-index-parser')["lines-into-row"]);
$('#or-import-blank').text($.i18n._('core-index-parser')["store-blank"]);
$('#or-import-null').text($.i18n._('core-index-parser')["store-nulls"]);
$('#or-import-source').html($.i18n._('core-index-parser')["store-source"]);
$('#or-import-ignore').text($.i18n._('core-index-parser')["ignore-first"]);
$('#or-import-lines').text($.i18n._('core-index-parser')["lines-beg"]);
$('#or-import-parse').text($.i18n._('core-index-parser')["parse-next"]);
$('#or-import-header').text($.i18n._('core-index-parser')["lines-header"]);
$('#or-import-discard').text($.i18n._('core-index-parser')["discard-initial"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-rows2').text($.i18n._('core-index-parser')["rows-data"]);
this._optionContainerElmts.encodingInput this._optionContainerElmts.encodingInput
.attr('value', this._config.encoding || '') .attr('value', this._config.encoding || '')
.click(function() { .click(function() {

View File

@ -2,14 +2,14 @@
<tr> <tr>
<td><div class="grid-layout layout-tighter"><table> <td><div class="grid-layout layout-tighter"><table>
<tr> <tr>
<td width="1%">Character&nbsp;encoding</td> <td width="1%" id="or-import-encoding"></td>
<td><input bind="encodingInput"></input></td> <td><input bind="encodingInput"></input></td>
</tr> </tr>
</table></div></td> </table></div></td>
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>

View File

@ -76,6 +76,9 @@ Refine.RdfTriplesParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-encoding').html($.i18n._('core-index-import')["char-encoding"]);
this._optionContainerElmts.encodingInput this._optionContainerElmts.encodingInput
.attr('value', this._config.encoding || '') .attr('value', this._config.encoding || '')
.click(function() { .click(function() {

View File

@ -2,50 +2,50 @@
<tr> <tr>
<td><div class="grid-layout layout-tighter"><table> <td><div class="grid-layout layout-tighter"><table>
<tr> <tr>
<td width="1%">Character&nbsp;encoding</td> <td width="1%" id="or-import-encoding"></td>
<td><input bind="encodingInput"></input></td> <td><input bind="encodingInput"></input></td>
</tr> </tr>
</table></div></td> </table></div></td>
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="previewButton">Update&nbsp;Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td colspan="2">Columns are separated by</td></tr> <tr><td colspan="2" id="or-import-colsep"></td></tr>
<tr><td width="1%"><input type="radio" name="column-separator" value="comma" id="$column-separator-comma" /></td> <tr><td width="1%"><input type="radio" name="column-separator" value="comma" id="$column-separator-comma" /></td>
<td><label for="$column-separator-comma">commas (CSV)</label></td></tr> <td><label for="$column-separator-comma" id="or-import-commas"></label></td></tr>
<tr><td width="1%"><input type="radio" name="column-separator" value="tab" id="$column-separator-tab" /></td> <tr><td width="1%"><input type="radio" name="column-separator" value="tab" id="$column-separator-tab" /></td>
<td><label for="$column-separator-tab">tabs (TSV)</label></td></tr> <td><label for="$column-separator-tab" id="or-import-tabs"></label></td></tr>
<tr><td width="1%"><input type="radio" name="column-separator" value="custom" id="$column-separator-custom" /></td> <tr><td width="1%"><input type="radio" name="column-separator" value="custom" id="$column-separator-custom" /></td>
<td><label for="$column-separator-custom">custom</label> <td><label for="$column-separator-custom" id="or-import-custom"></label>
<input bind="columnSeparatorInput" type="text" class="lightweight" size="5" /></td></tr> <input bind="columnSeparatorInput" type="text" class="lightweight" size="5" /></td></tr>
<tr><td colspan="2">Escape special characters with \</td></tr> <tr><td colspan="2" id="or-import-escape"></td></tr>
</table></div></td> </table></div></td>
<td colspan="2"><div class="grid-layout layout-tightest"><table> <td colspan="2"><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td> <tr><td width="1%"><input type="checkbox" bind="ignoreCheckbox" id="$ignore" /></td>
<td><label for="$ignore">Ignore first</label></td> <td><label for="$ignore" id="or-import-ignore"></label></td>
<td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="ignoreInput" type="text" class="lightweight" size="2" value="0" />
<label for="$ignore">line(s) at beginning of file</label></td></tr> <label for="$ignore" id="or-import-lines"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td> <tr><td width="1%"><input type="checkbox" bind="headerLinesCheckbox" id="$headers" /></td>
<td><label for="$headers">Parse next</label></td> <td><label for="$headers" id="or-import-parse"></label></td>
<td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" /> <td><input bind="headerLinesInput" type="text" class="lightweight" size="2" value="1" />
<label for="$headers">line(s) as column headers</label></td></tr> <label for="$headers" id="or-import-header"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td> <tr><td width="1%"><input type="checkbox" bind="skipCheckbox" id="$skip" /></td>
<td><label for="$skip">Discard initial</label></td> <td><label for="$skip" id="or-import-discard"></label></td>
<td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="skipInput" type="text" class="lightweight" size="2" value="0" />
<label for="$skip">row(s) of data</label></td></tr> <label for="$skip" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">row(s) of data</label></td></tr> <label for="$limit" id="or-import-rows2"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
@ -53,20 +53,20 @@
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td> <tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr> <td><label for="$guess" id="or-import-parseCell"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="processQuoteMarksCheckbox" id="$quotes" /></td> <tr><td width="1%"><input type="checkbox" bind="processQuoteMarksCheckbox" id="$quotes" /></td>
<td><label for="$quotes">Quotation marks are used<br/>to enclose cells containing<br/>column separators</label></td></tr> <td><label for="$quotes" id="or-import-quote"></label></td></tr>
</table></div></td> </table></div></td>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankRowsCheckbox" id="$store-blank-rows" /></td>
<td colspan="2"><label for="$store-blank-rows">Store blank rows</label></td></tr> <td colspan="2"><label for="$store-blank-rows" id="or-import-blank"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td> <tr><td width="1%"><input type="checkbox" bind="storeBlankCellsAsNullsCheckbox" id="$store-blank-cells" /></td>
<td colspan="2"><label for="$store-blank-cells">Store blank cells as nulls</label></td></tr> <td colspan="2"><label for="$store-blank-cells" id="or-import-null"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td><label for="$include-file-sources">Store file source<br/>(file names, URLs)<br/>in each row</label></td></tr> <td><label for="$include-file-sources" id="or-import-source"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -126,6 +126,28 @@ Refine.SeparatorBasedParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-encoding').html($.i18n._('core-index-import')["char-encoding"]);
$('#or-import-colsep').html($.i18n._('core-index-parser')["col-separated-by"]);
$('#or-import-commas').html($.i18n._('core-index-parser')["commas"]);
$('#or-import-tabs').html($.i18n._('core-index-parser')["tabs"]);
$('#or-import-custom').html($.i18n._('core-index-parser')["custom"]);
$('#or-import-escape').html($.i18n._('core-index-parser')["escape"]);
$('#or-import-ignore').text($.i18n._('core-index-parser')["ignore-first"]);
$('#or-import-lines').text($.i18n._('core-index-parser')["lines-beg"]);
$('#or-import-parse').text($.i18n._('core-index-parser')["parse-next"]);
$('#or-import-header').text($.i18n._('core-index-parser')["lines-header"]);
$('#or-import-discard').text($.i18n._('core-index-parser')["discard-initial"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-rows2').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-parseCell').html($.i18n._('core-index-parser')["parse-cell"]);
$('#or-import-quote').html($.i18n._('core-index-parser')["quotation-mark"]);
$('#or-import-blank').text($.i18n._('core-index-parser')["store-blank"]);
$('#or-import-null').text($.i18n._('core-index-parser')["store-nulls"]);
$('#or-import-source').html($.i18n._('core-index-parser')["store-source"]);
this._optionContainerElmts.encodingInput this._optionContainerElmts.encodingInput
.attr('value', this._config.encoding || '') .attr('value', this._config.encoding || '')
.click(function() { .click(function() {

View File

@ -1,4 +1,4 @@
<div class="xml-parser-ui-select-message"> <div class="xml-parser-ui-select-message">
Click on the first XML element corresponding to the first record to load. <span id="or-import-clickXML"></span>
</div> </div>
<div class="xml-parser-ui-select-dom" bind="domContainer"></div> <div class="xml-parser-ui-select-dom" bind="domContainer"></div>

View File

@ -3,26 +3,26 @@
<td colspan="2"><div class="grid-layout layout-tighter layout-full"><table> <td colspan="2"><div class="grid-layout layout-tighter layout-full"><table>
<tr> <tr>
<td style="text-align: right;">&nbsp;</td> <td style="text-align: right;">&nbsp;</td>
<td width="1%"><button class="button" bind="pickRecordElementsButton">Pick Record Elements</button></td> <td width="1%"><button class="button" bind="pickRecordElementsButton"></button></td>
<td width="1%"><button class="button" bind="previewButton">Update Preview</button></td> <td width="1%"><button class="button" bind="previewButton"></button></td>
</tr> </tr>
</table></div></td> </table></div></td>
</tr> </tr>
<tr> <tr>
<td><div class="grid-layout layout-tightest"><table> <td><div class="grid-layout layout-tightest"><table>
<tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td> <tr><td width="1%"><input type="checkbox" bind="limitCheckbox" id="$limit" /></td>
<td><label for="$limit">Load at most</label></td> <td><label for="$limit" id="or-import-load"></label></td>
<td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" /> <td><input bind="limitInput" type="text" class="lightweight" size="2" value="0" />
<label for="$limit">record(s) of data</label></td></tr> <label for="$limit" id="or-import-rows"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="storeEmptyStringsCheckbox" id="$store-empty-strings" /></td> <tr><td width="1%"><input type="checkbox" bind="storeEmptyStringsCheckbox" id="$store-empty-strings" /></td>
<td colspan="2"><label for="$store-empty-strings">Preserve empty strings</label></td></tr> <td colspan="2"><label for="$store-empty-strings" id="or-import-preserve"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="trimStringsCheckbox" id="$trim" /></td> <tr><td width="1%"><input type="checkbox" bind="trimStringsCheckbox" id="$trim" /></td>
<td><label for="$guess">Trim leading &amp; trailing whitespace from strings</label></td></tr> <td><label for="$guess" id="or-import-trim"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td> <tr><td width="1%"><input type="checkbox" bind="guessCellValueTypesCheckbox" id="$guess" /></td>
<td><label for="$guess">Parse cell text into<br/>numbers, dates, ...</label></td></tr> <td><label for="$guess" id="or-import-parseCell"></label></td></tr>
<tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td> <tr><td width="1%"><input type="checkbox" bind="includeFileSourcesCheckbox" id="$include-file-sources" /></td>
<td colspan="2"><label for="$include-file-sources">Store file source (file names, URLs) in each row</label></td></tr> <td colspan="2"><label for="$include-file-sources" id="or-import-store"></label></td></tr>
</table></div></td> </table></div></td>
</tr> </tr>
</table></div> </table></div>

View File

@ -61,7 +61,7 @@ Refine.XmlParserUI.prototype.confirmReadyToCreateProject = function() {
if ((this._config.recordPath) && this._config.recordPath.length > 0) { if ((this._config.recordPath) && this._config.recordPath.length > 0) {
return true; return true;
} else { } else {
window.alert('Please specify a record path first.'); window.alert($.i18n._('core-index-import')["warning-record-path"]);
} }
}; };
@ -102,6 +102,15 @@ Refine.XmlParserUI.prototype._initialize = function() {
this._optionContainerElmts = DOM.bind(this._optionContainer); this._optionContainerElmts = DOM.bind(this._optionContainer);
this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); }); this._optionContainerElmts.previewButton.click(function() { self._updatePreview(); });
this._optionContainerElmts.pickRecordElementsButton.html($.i18n._('core-buttons')["pick-record"]);
this._optionContainerElmts.previewButton.html($.i18n._('core-buttons')["update-preview"]);
$('#or-import-rows').text($.i18n._('core-index-parser')["rows-data"]);
$('#or-import-load').text($.i18n._('core-index-parser')["load-at-most"]);
$('#or-import-preserve').text($.i18n._('core-index-parser')["preserve-empty"]);
$('#or-import-trim').text($.i18n._('core-index-parser')["trim"]);
$('#or-import-parseCell').text($.i18n._('core-index-parser')["parse-cell"]);
$('#or-import-store').text($.i18n._('core-index-parser')["store-source"]);
if (this._config.limit > 0) { if (this._config.limit > 0) {
this._optionContainerElmts.limitCheckbox.attr("checked", "checked"); this._optionContainerElmts.limitCheckbox.attr("checked", "checked");
this._optionContainerElmts.limitInput[0].value = this._config.limit.toString(); this._optionContainerElmts.limitInput[0].value = this._config.limit.toString();
@ -135,6 +144,8 @@ Refine.XmlParserUI.prototype._showPickRecordElementsUI = function() {
this._dataContainer.unbind().empty().html( this._dataContainer.unbind().empty().html(
DOM.loadHTML("core", "scripts/index/parser-interfaces/xml-parser-select-ui.html")); DOM.loadHTML("core", "scripts/index/parser-interfaces/xml-parser-select-ui.html"));
$('#or-import-clickXML').text($.i18n._('core-index-parser')["click-xml"]);
var elmts = DOM.bind(this._dataContainer); var elmts = DOM.bind(this._dataContainer);
var escapeElmt = $('<span>'); var escapeElmt = $('<span>');

View File

@ -1,11 +1,11 @@
<div class="dialog-frame" style="width: 600px;"> <div class="dialog-frame" style="width: 600px;">
<div class="dialog-border"> <div class="dialog-border">
<div class="dialog-header" bind="dialogHeader">Select Encoding</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div id="select-encodings-tabs" class="refine-tabs"> <div id="select-encodings-tabs" class="refine-tabs">
<ul> <ul>
<li><a href="#select-encodings-tabs-common">Common Encodings</a></li> <li><a href="#select-encodings-tabs-common" id="or-enc-common"></a></li>
<li><a href="#select-encodings-tabs-all">All Encodings</a></li> <li><a href="#select-encodings-tabs-all" id="or-enc-all"></a></li>
</ul> </ul>
<div id="select-encodings-tabs-common"> <div id="select-encodings-tabs-common">
<div class="select-encoding-dialog-encoding-list" bind="commonList"></div> <div class="select-encoding-dialog-encoding-list" bind="commonList"></div>
@ -16,7 +16,7 @@
</div> </div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -44,8 +44,8 @@ function PreferenceUI(tr, key, value) {
var td2 = tr.insertCell(2); var td2 = tr.insertCell(2);
$('<button class="button">').text("Edit").appendTo(td2).click(function() { $('<button class="button">').text($.i18n._('core-index')["edit"]).appendTo(td2).click(function() {
var newValue = window.prompt("Change value of preference key " + key, value); var newValue = window.prompt($.i18n._('core-index')["change-value"]+" " + key, value);
if (newValue !== null) { if (newValue !== null) {
$(td1).text(newValue); $(td1).text(newValue);
$.post( $.post(
@ -64,8 +64,8 @@ function PreferenceUI(tr, key, value) {
} }
}); });
$('<button class="button">').text("Delete").appendTo(td2).click(function() { $('<button class="button">').text($.i18n._('core-index')["delete"]).appendTo(td2).click(function() {
if (window.confirm("Delete preference key " + key + "?")) { if (window.confirm($.i18n._('core-index')["delete-key"]+" " + key + "?")) {
$.post( $.post(
"command/core/set-preference", "command/core/set-preference",
{ {
@ -94,12 +94,13 @@ function PreferenceUI(tr, key, value) {
function populatePreferences(prefs) { function populatePreferences(prefs) {
var body = $("#body-info").empty(); var body = $("#body-info").empty();
$('<h1>').text("Preferences").appendTo(body); $("#or-proj-starting").text($.i18n._('core-project')["starting"]+"...");
$('<h1>').text($.i18n._('core-index')["preferences"]).appendTo(body);
var table = $('<table>') var table = $('<table>')
.addClass("list-table") .addClass("list-table")
.addClass("preferences") .addClass("preferences")
.html('<tr><th>Key</th><th>Value</th><th></th></tr>') .html('<tr><th>'+$.i18n._('core-index')["key"]+'</th><th>'+$.i18n._('core-index')["value"]+'</th><th></th></tr>')
.appendTo(body)[0]; .appendTo(body)[0];
for (var k in prefs) { for (var k in prefs) {
@ -111,10 +112,10 @@ function populatePreferences(prefs) {
var tdLast0 = trLast.insertCell(0); var tdLast0 = trLast.insertCell(0);
trLast.insertCell(1); trLast.insertCell(1);
trLast.insertCell(2); trLast.insertCell(2);
$('<button class="button">').text("Add Preference").appendTo(tdLast0).click(function() { $('<button class="button">').text().appendTo(tdLast0).click(function() {
var key = window.prompt("Preference key:"); var key = window.prompt($.i18n._('core-index')["add-pref"]);
if (key) { if (key) {
var value = window.prompt("Preference key value:"); var value = window.prompt($.i18n._('core-index')["pref-key"]);
if (value !== null) { if (value !== null) {
var tr = table.insertRow(table.rows.length - 1); var tr = table.insertRow(table.rows.length - 1);
preferenceUIs.push(new PreferenceUI(tr, key, value)); preferenceUIs.push(new PreferenceUI(tr, key, value));

View File

@ -34,6 +34,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var theProject; var theProject;
var ui = {}; 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
},
success : function(data) {
dictionary = data;
}
});
$.i18n.setDictionary(dictionary);
// End internationalization
var Refine = { var Refine = {
refineHelperService: "http://openrefine-helper.freebaseapps.com" refineHelperService: "http://openrefine-helper.freebaseapps.com"
}; };
@ -106,6 +123,16 @@ function initializeUI(uiState) {
$("#project-controls").show(); $("#project-controls").show();
$("#body").show(); $("#body").show();
$("#or-proj-open").text($.i18n._('core-project')["open"]+"...");
$("#project-permalink-button").text($.i18n._('core-project')["permalink"]);
$("#project-name-button").attr("title",$.i18n._('core-project')["proj-name"]);
$("#or-proj-export").text($.i18n._('core-project')["export"]);
$("#or-proj-help").text($.i18n._('core-project')["help"]);
$("#or-proj-starting").text($.i18n._('core-project')["starting"]+"...");
$("#or-proj-facFil").text($.i18n._('core-project')["facet-filter"]);
$("#or-proj-undoRedo").text($.i18n._('core-project')["undo-redo"]);
$("#or-proj-ext").text($.i18n._('core-project')["extensions"]+":");
$('#project-name-button').click(Refine._renameProject); $('#project-name-button').click(Refine._renameProject);
$('#project-permalink-button').mouseenter(function() { $('#project-permalink-button').mouseenter(function() {
this.href = Refine.getPermanentLink(); this.href = Refine.getPermanentLink();
@ -183,7 +210,7 @@ Refine.reinitializeProjectData = function(f, fError) {
}; };
Refine._renameProject = function() { Refine._renameProject = function() {
var name = window.prompt("New project name:", theProject.metadata.name); var name = window.prompt($.i18n._('core-index')["new-proj-name"], theProject.metadata.name);
if (name === null) { if (name === null) {
return; return;
} }
@ -203,7 +230,7 @@ Refine._renameProject = function() {
theProject.metadata.name = name; theProject.metadata.name = name;
Refine.setTitle(); Refine.setTitle();
} else { } else {
alert("Failed to rename project: " + data.message); alert($.i18n._('core-index')["error-rename"]+" " + data.message);
} }
} }
}); });

View File

@ -96,20 +96,20 @@ BrowsingEngine.prototype._initializeUI = function() {
this._div.html( this._div.html(
'<div class="browsing-panel-help" bind="help">' + '<div class="browsing-panel-help" bind="help">' +
'<h1>Using facets and filters</h1>' + '<h1>'+$.i18n._('core-project')["use-facets"]+'</h1>' +
'<p>Use facets and filters to select subsets of your data to act on. Choose facet and filter methods from the menus at the top of each data column.</p>' + '<p>'+$.i18n._('core-project')["use-to-select"]+'</p>' +
'<p>Not sure how to get started?<br /><a href="http://github.com/OpenRefine/OpenRefine/wiki/Screencasts" target="_blank"><b>Watch these screencasts</b></a></p>' + '<p>'+$.i18n._('core-project')["not-sure"]+'<br /><a href="http://github.com/OpenRefine/OpenRefine/wiki/Screencasts" target="_blank"><b>'+$.i18n._('core-project')["watch-cast"]+'</b></a></p>' +
'</div>' + '</div>' +
'<div class="browsing-panel-header" bind="header">' + '<div class="browsing-panel-header" bind="header">' +
'<div class="browsing-panel-indicator" bind="indicator">' + '<div class="browsing-panel-indicator" bind="indicator">' +
'<img src="images/small-spinner.gif" /> Refreshing facets...' + '<img src="images/small-spinner.gif" /> '+$.i18n._('core-project')["refreshing-facet"]+'' +
'</div>' + '</div>' +
'<div class="browsing-panel-controls" bind="controls">' + '<div class="browsing-panel-controls" bind="controls">' +
'<div class="browsing-panel-controls-refresh">' + '<div class="browsing-panel-controls-refresh">' +
'<a href="javascript:{}" bind="refreshLink" class="button" title="Update all facets">Refresh</a>' + '<a href="javascript:{}" bind="refreshLink" class="button" title="'+$.i18n._('core-project')["update-facets"]+'">'+$.i18n._('core-buttons')["refresh"]+'</a>' +
'</div>' + '</div>' +
'<a href="javascript:{}" bind="resetLink" class="button button-pill-left" title="Clear selection in all facets">Reset All</a>' + '<a href="javascript:{}" bind="resetLink" class="button button-pill-left" title="'+$.i18n._('core-project')["clear-selection"]+'">'+$.i18n._('core-buttons')["reset-all"]+'</a>' +
'<a href="javascript:{}" bind="removeLink" class="button button-pill-right" title="Remove all facets">Remove All</a>' + '<a href="javascript:{}" bind="removeLink" class="button button-pill-right" title="'+$.i18n._('core-project')["remove-all"]+'">'+$.i18n._('core-buttons')["remove-all"]+'</a>' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<ul bind="facets" class="facets-container"></ul>' '<ul bind="facets" class="facets-container"></ul>'

View File

@ -41,55 +41,55 @@ ExporterManager.handlers = {};
ExporterManager.MenuItems = [ ExporterManager.MenuItems = [
{ {
"id" : "core/export-project", "id" : "core/export-project",
"label": "Export project", "label": $.i18n._('core-project')["export-project"],
"click": function() { ExporterManager.handlers.exportProject(); } "click": function() { ExporterManager.handlers.exportProject(); }
}, },
{}, {},
{ {
"id" : "core/export-tsv", "id" : "core/export-tsv",
"label": "Tab-separated value", "label": $.i18n._('core-project')["tab-value"],
"click": function() { ExporterManager.handlers.exportRows("tsv", "tsv"); } "click": function() { ExporterManager.handlers.exportRows("tsv", "tsv"); }
}, },
{ {
"id" : "core/export-csv", "id" : "core/export-csv",
"label": "Comma-separated value", "label": $.i18n._('core-project')["comma-sep"],
"click": function() { ExporterManager.handlers.exportRows("csv", "csv"); } "click": function() { ExporterManager.handlers.exportRows("csv", "csv"); }
}, },
{ {
"id" : "core/export-html-table", "id" : "core/export-html-table",
"label": "HTML table", "label": $.i18n._('core-project')["html-table"],
"click": function() { ExporterManager.handlers.exportRows("html", "html"); } "click": function() { ExporterManager.handlers.exportRows("html", "html"); }
}, },
{ {
"id" : "core/export-excel", "id" : "core/export-excel",
"label": "Excel", "label": $.i18n._('core-project')["excel"],
"click": function() { ExporterManager.handlers.exportRows("xls", "xls"); } "click": function() { ExporterManager.handlers.exportRows("xls", "xls"); }
}, },
{ {
"id" : "core/export-ods", "id" : "core/export-ods",
"label": "ODF spreadsheet", "label": $.i18n._('core-project')["odf"],
"click": function() { ExporterManager.handlers.exportRows("ods", "ods"); } "click": function() { ExporterManager.handlers.exportRows("ods", "ods"); }
}, },
{}, {},
{ {
"id" : "core/export-tripleloader", "id" : "core/export-tripleloader",
"label": "Triple loader", "label": $.i18n._('core-project')["triple-loader"],
"click": function() { ExporterManager.handlers.exportTripleloader("tripleloader"); } "click": function() { ExporterManager.handlers.exportTripleloader("tripleloader"); }
}, },
{ {
"id" : "core/export-mqlwrite", "id" : "core/export-mqlwrite",
"label": "MQLWrite", "label": $.i18n._('core-project')["mqlwrite"],
"click": function() { ExporterManager.handlers.exportTripleloader("mqlwrite"); } "click": function() { ExporterManager.handlers.exportTripleloader("mqlwrite"); }
}, },
{}, {},
{ {
"id" : "core/export-custom-tabular", "id" : "core/export-custom-tabular",
"label": "Custom tabular exporter...", "label": $.i18n._('core-project')["custom-tabular"],
"click": function() { new CustomTabularExporterDialog(); } "click": function() { new CustomTabularExporterDialog(); }
}, },
{ {
"id" : "core/export-templating", "id" : "core/export-templating",
"label": "Templating...", "label": $.i18n._('core-project')["templating"],
"click": function() { new TemplatingExporterDialog(); } "click": function() { new TemplatingExporterDialog(); }
} }
]; ];
@ -109,10 +109,7 @@ ExporterManager.prototype._initializeUI = function() {
ExporterManager.handlers.exportTripleloader = function(format) { ExporterManager.handlers.exportTripleloader = function(format) {
if (!theProject.overlayModels.freebaseProtograph) { if (!theProject.overlayModels.freebaseProtograph) {
alert( alert($.i18n._('triple-loader')["warning-align"]);
"You haven't done any schema alignment yet,\nso there is no triple to export.\n\n" +
"Use the Freebase > Edit Schema Alignment Skeleton...\ncommand to align your data with Freebase schemas first."
);
} else { } else {
ExporterManager.handlers.exportRows(format, "txt"); ExporterManager.handlers.exportRows(format, "txt");
} }

View File

@ -1,15 +1,13 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-border"> <div class="dialog-border">
<div class="dialog-header" bind="dialogHeader">Apply Operation History</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div class="dialog-instruction"> <div class="dialog-instruction" bind="or_proj_pasteJson"></div>
Paste an extracted JSON history of operations to perform:
</div>
<div class="input-container"><textarea wrap="off" bind="textarea" class="history-operation-json" /></div> <div class="input-container"><textarea wrap="off" bind="textarea" class="history-operation-json" /></div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="applyButton">Perform Operations</button> <button class="button" bind="applyButton"></button>
<button class="button" bind="cancelButton">Cancel</button> <button class="button" bind="cancelButton"></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,11 +1,11 @@
<div class="dialog-frame" style="width: 800px;"> <div class="dialog-frame" style="width: 800px;">
<div class="dialog-border"> <div class="dialog-border">
<div class="dialog-header" bind="dialogHeader">Extract Operation History</div> <div class="dialog-header" bind="dialogHeader"></div>
<div class="dialog-body" bind="dialogBody"> <div class="dialog-body" bind="dialogBody">
<div class="grid-layout layout-normal layout-full"><table> <div class="grid-layout layout-normal layout-full"><table>
<tr> <tr>
<td colspan="2"> <td colspan="2" bind="or_proj_extractSave">
Extract and save parts of your operation history as JSON that you can apply to this or other projects in the future.
</td> </td>
</tr> </tr>
<tr> <tr>
@ -16,14 +16,14 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<button class="button" bind="selectAllButton">Select All</button> <button class="button" bind="selectAllButton"></button>
<button class="button" bind="unselectAllButton">Unselect All</button> <button class="button" bind="unselectAllButton"></button>
</td> </td>
</tr> </tr>
</table></div> </table></div>
</div> </div>
<div class="dialog-footer" bind="dialogFooter"> <div class="dialog-footer" bind="dialogFooter">
<button class="button" bind="closeButton">Close</button> <button class="button" bind="closeButton"></button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,13 +1,13 @@
<div class="history-panel-help" bind="helpDiv"> <div class="history-panel-help" bind="helpDiv">
<h1>Infinite undo history</h1> <h1 bind="or_proj_undo"></h1>
<p>Don't worry about making mistakes. Every change you make will be shown here, and you can undo your changes anytime.</p> <p bind="or_proj_mistakes"></p>
<p><a href="http://github.com/OpenRefine/OpenRefine/wiki/History" target="_blank"><b>Learn more &raquo;</b></a></p> <p><a href="http://github.com/OpenRefine/OpenRefine/wiki/History" target="_blank"><b><span bind="or_proj_learnMore"></span></b></a></p>
</div> </div>
<div class="history-panel-controls" bind="controlsDiv"> <div class="history-panel-controls" bind="controlsDiv">
<a class="button button-pill-left" href="javascript:{}" bind="extractLink">Extract&hellip;</a><a class="button button-pill-right" href="javascript:{}" bind="applyLink">Apply&hellip;</a> <a class="button button-pill-left" href="javascript:{}" bind="extractLink"></a><a class="button button-pill-right" href="javascript:{}" bind="applyLink"></a>
</div> </div>
<div class="history-panel-filter" bind="bodyControlsDiv"> <div class="history-panel-filter" bind="bodyControlsDiv">
Filter: <input type="text" size="30" bind="filterInput" /> <span bind="or_proj_filter"> </span><input type="text" size="30" bind="filterInput" />
</div> </div>
<div class="history-panel-body" bind="bodyDiv"> <div class="history-panel-body" bind="bodyDiv">
<div class="history-past" bind="pastDiv"> <div class="history-past" bind="pastDiv">

View File

@ -69,12 +69,20 @@ HistoryPanel.prototype.update = function(onDone) {
HistoryPanel.prototype._render = function() { HistoryPanel.prototype._render = function() {
var self = this; var self = this;
this._tabHeader.html('Undo / Redo <span class="count">' + this._data.past.length + '</span>'); this._tabHeader.html($.i18n._('core-project')["undo-redo"]+' <span class="count">' + this._data.past.length + '</span>');
this._div.empty().unbind().html(DOM.loadHTML("core", "scripts/project/history-panel.html")); this._div.empty().unbind().html(DOM.loadHTML("core", "scripts/project/history-panel.html"));
var elmts = DOM.bind(this._div); var elmts = DOM.bind(this._div);
elmts.or_proj_undo.html($.i18n._('core-project')["undo-history"]);
elmts.or_proj_mistakes.html($.i18n._('core-project')["mistakes"]);
elmts.or_proj_learnMore.html($.i18n._('core-project')["learn-more"]);
elmts.applyLink.html($.i18n._('core-project')["apply"]);
elmts.extractLink.html($.i18n._('core-project')["extract"]);
elmts.or_proj_mistakes.html($.i18n._('core-project')["mistakes"]);
elmts.or_proj_filter.html($.i18n._('core-project')["filter"]);
var renderEntry = function(container, index, entry, lastDoneID, past) { var renderEntry = function(container, index, entry, lastDoneID, past) {
var a = $(DOM.loadHTML("core", "scripts/project/history-entry.html")).appendTo(container); var a = $(DOM.loadHTML("core", "scripts/project/history-entry.html")).appendTo(container);
if (lastDoneID >= 0) { if (lastDoneID >= 0) {
@ -187,6 +195,12 @@ HistoryPanel.prototype._showExtractOperationsDialog = function(json) {
var frame = $(DOM.loadHTML("core", "scripts/project/history-extract-dialog.html")); var frame = $(DOM.loadHTML("core", "scripts/project/history-extract-dialog.html"));
var elmts = DOM.bind(frame); var elmts = DOM.bind(frame);
elmts.dialogHeader.html($.i18n._('core-project')["extract-history"]);
elmts.or_proj_extractSave.html($.i18n._('core-project')["extract-save"]);
elmts.selectAllButton.html($.i18n._('core-buttons')["select-all"]);
elmts.unselectAllButton.html($.i18n._('core-buttons')["unselect-all"]);
elmts.closeButton.html($.i18n._('core-buttons')["close"]);
var entryTable = elmts.entryTable[0]; var entryTable = elmts.entryTable[0];
var createEntry = function(entry) { var createEntry = function(entry) {
var tr = entryTable.insertRow(entryTable.rows.length); var tr = entryTable.insertRow(entryTable.rows.length);
@ -251,6 +265,12 @@ HistoryPanel.prototype._showApplyOperationsDialog = function() {
var frame = $(DOM.loadHTML("core", "scripts/project/history-apply-dialog.html")); var frame = $(DOM.loadHTML("core", "scripts/project/history-apply-dialog.html"));
var elmts = DOM.bind(frame); var elmts = DOM.bind(frame);
elmts.dialogHeader.html($.i18n._('core-project')["apply-operation"]);
elmts.or_proj_pasteJson.html($.i18n._('core-project')["paste-json"]);
elmts.applyButton.html($.i18n._('core-buttons')["perform-op"]);
elmts.cancelButton.html($.i18n._('core-buttons')["cancel"]);
var fixJson = function(json) { var fixJson = function(json) {
json = json.trim(); json = json.trim();
if (!json.startsWith("[")) { if (!json.startsWith("[")) {
@ -271,7 +291,7 @@ HistoryPanel.prototype._showApplyOperationsDialog = function() {
json = fixJson(json); json = fixJson(json);
json = JSON.parse(json); json = JSON.parse(json);
} catch (e) { } catch (e) {
alert("The JSON you pasted is invalid."); alert($.i18n._('core-project')["json-invalid"]+".");
return; return;
} }

View File

@ -43,6 +43,8 @@ function ProcessPanel(div) {
this._div.html(DOM.loadHTML("core", "scripts/project/progress-panel.html")); this._div.html(DOM.loadHTML("core", "scripts/project/progress-panel.html"));
this._elmts = DOM.bind(this._div); this._elmts = DOM.bind(this._div);
this._elmts.undoLink.html($.i18n._('core-project')["undo"]);
var self = this; var self = this;
$(window).keypress(function(evt) { $(window).keypress(function(evt) {
if (evt.charCode == 26 || (evt.charCode == 122 && (evt.ctrlKey || evt.metaKey))) { // ctrl-z or meta-z if (evt.charCode == 26 || (evt.charCode == 122 && (evt.ctrlKey || evt.metaKey))) { // ctrl-z or meta-z
@ -147,9 +149,9 @@ ProcessPanel.prototype._render = function(newData) {
for (var i = 0; i < processes.length; i++) { for (var i = 0; i < processes.length; i++) {
var process = processes[i]; var process = processes[i];
if (process.status != "pending") { if (process.status != "pending") {
Refine.setTitle(process.progress + "% complete"); Refine.setTitle(process.progress + "% "+elmts.or_proj_undo.html($.i18n._('core-project')["complete"]));
this._elmts.progressDescription.text(process.description); this._elmts.progressDescription.text(process.description);
this._elmts.progressSpan.text(process.progress + '% complete'); this._elmts.progressSpan.text(process.progress + '% '+elmts.or_proj_undo.html($.i18n._('core-project')["complete"]));
} }
if ("onDone" in process) { if ("onDone" in process) {
newProcessMap[process.id] = process; newProcessMap[process.id] = process;
@ -158,16 +160,16 @@ ProcessPanel.prototype._render = function(newData) {
if (processes.length > 1) { if (processes.length > 1) {
var pending = processes.length - 1; var pending = processes.length - 1;
this._elmts.countSpan.text('(' + pending + (pending > 1 ? ' other pending processes)' : ' other pending process)')); this._elmts.countSpan.text('(' + pending + (pending > 1 ? ' '+$.i18n._('core-project')["other-processes"]+')' : ' '+$.i18n._('core-project')["other-process"]+')'));
} else { } else {
this._elmts.countSpan.empty(); this._elmts.countSpan.empty();
} }
this._elmts.cancelLink this._elmts.cancelLink
.unbind() .unbind()
.text(processes.length > 1 ? "Cancel All" : "Cancel") .text(processes.length > 1 ? $.i18n._('core-project')["cancel-all"] : $.i18n._('core-project')["cancel"])
.click(function() { .click(function() {
self._cancelAll(); self._cancelAll();
$(this).text("Canceling...").unbind(); $(this).text($.i18n._('core-project')["canceling"]).unbind();
}) })
this._div.fadeIn(200); this._div.fadeIn(200);
@ -190,10 +192,10 @@ ProcessPanel.prototype._render = function(newData) {
}).join('\n'); }).join('\n');
if (this._data.processes.length == 0) { if (this._data.processes.length == 0) {
window.alert('The last operation encountered some errors:\n' + messages); window.alert($.i18n._('core-project')["last-op-er"]+':\n' + messages);
} else { } else {
if (window.confirm('The last operation encountered some errors:\n' + messages + if (window.confirm($.i18n._('core-project')["last-op-er"]+':\n' + messages +
'\n\nContinue with the remaining operations?')) { '\n\n'+$.i18n._('core-project')["continue-remaining"]+'?')) {
$.post( $.post(
"command/core/apply-operations?" + $.param({ project: theProject.id }), "command/core/apply-operations?" + $.param({ project: theProject.id }),
{ operations: '[]' }, { operations: '[]' },

View File

@ -10,6 +10,6 @@
</div> </div>
<div bind="undoDiv"> <div bind="undoDiv">
<span bind="undoDescription"></span> <span bind="undoDescription"></span>
<span class="notification-action"><a href="javascript:{}" bind="undoLink">Undo</a></span> <span class="notification-action"><a href="javascript:{}" bind="undoLink"></a></span>
</div> </div>
</div> </div>

View File

@ -42,7 +42,7 @@ SummaryBar.prototype._initializeUI = function() {
SummaryBar.prototype.updateResultCount = function() { SummaryBar.prototype.updateResultCount = function() {
var summaryText; var summaryText;
var units = theProject.rowModel.mode == "row-based" ? "rows" : "records"; var units = theProject.rowModel.mode == "row-based" ? $.i18n._('core-views')["rows"] : $.i18n._('core-views')["records"];
if (theProject.rowModel.filtered == theProject.rowModel.total) { if (theProject.rowModel.filtered == theProject.rowModel.total) {
summaryText = (theProject.rowModel.total) + ' ' + units; summaryText = (theProject.rowModel.total) + ' ' + units;
} else { } else {

Some files were not shown because too many files have changed in this diff Show More