gdata-extension internationalization
This commit is contained in:
parent
3acc5291ce
commit
696eccc872
@ -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;
|
||||||
|
@ -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>
|
||||||
|
@ -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";
|
||||||
|
56
extensions/gdata/module/langs/translation-en.json
Normal file
56
extensions/gdata/module/langs/translation-en.json
Normal 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 »",
|
||||||
|
"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": "« Start Over",
|
||||||
|
"conf-pars": "Configure Parsing Options",
|
||||||
|
"proj-name": "Project name",
|
||||||
|
"create-proj": "Create Project »",
|
||||||
|
"updating-preview": "Updating preview ...",
|
||||||
|
"worksheet": "Worksheets",
|
||||||
|
"option": "Options",
|
||||||
|
"preview-button": "Update 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."
|
||||||
|
}
|
||||||
|
}
|
56
extensions/gdata/module/langs/translation-it.json
Normal file
56
extensions/gdata/module/langs/translation-it.json
Normal 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 »",
|
||||||
|
"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": "« Ricomincia",
|
||||||
|
"conf-pars": "Configura le opzioni per il parsing",
|
||||||
|
"proj-name": "Nome del progetto",
|
||||||
|
"create-proj": "Crea un progetto »",
|
||||||
|
"updating-preview": "Aggiornando la preview ...",
|
||||||
|
"worksheet": "Worksheets",
|
||||||
|
"option": "Opzioni",
|
||||||
|
"preview-button": "Aggiorna la 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."
|
||||||
|
}
|
||||||
|
}
|
@ -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">« Start Over</button></td>
|
<td width="1%"><button bind="startOverButton" class="button">« 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 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 »</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 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>
|
@ -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">« 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 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 »</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 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>
|
@ -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];
|
||||||
|
|
||||||
|
@ -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 »</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>
|
||||||
|
@ -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').i18n._('gdata-auth')["authorize-label"];
|
||||||
|
$('#gdata-authorized').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);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
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 +52,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 +70,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"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
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.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[] langs = request.getParameterValues("lng");
|
||||||
|
langs = langs[0].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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user