Permalink
Browse files

I18N new uploader

  • Loading branch information...
1 parent 7a1f06d commit 3385a4a42997b7bca507834a72aecb694d5ccf97 @cdujeu cdujeu committed Oct 14, 2016
@@ -262,7 +262,7 @@
"208" => "You have no read permission on this folder",
"209" => "Internal server error, please contact Administrator!",
"210" => "Upload failed",
-"211" => "The file is too big!",
+"211" => "The file is too big! Please contact your administrator or use the desktop sync client.",
"212" => "No file found on server!",
"213" => "Error while copying file to current folder",
"214" => "Browse",
@@ -392,8 +392,8 @@
"334" => "more",
"335" => "Please enter a page number between 1 and ",
"336" => "Sorry you cannot drop folders, drop only files!",
-"337" => "Auto start upload",
-"338" => "Auto close after upload",
+"337" => "Start uploading automatically",
+"338" => "Close panel after upload is finished",
"339" => "Existing Files",
"340" => "Alert",
"341" => "File Info",
@@ -263,7 +263,7 @@
"208" => "Vous n'avez pas le droit de lire dans ce répertoire",
"209" => "Erreur interne du serveur. Contactez l'administrateur !",
"210" => "Echec lors du transfert.",
-"211" => "Le fichier dépasse la taille autorisée",
+"211" => "Le fichier dépasse la taille autorisée, veuillez contacter votre administrateur ou utiliser l'application de synchronisation.",
"212" => "Aucun fichier trouvé sur le serveur !",
"213" => "Erreur lors de la copie du fichier temporaire.",
"214" => "Parcourir",
@@ -0,0 +1,44 @@
+<?php
+/*
+ * Copyright 2007-2016 Abstrium <contact (at) pydio.com>
+ * This file is part of Pydio.
+ *
+ * Pydio is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Pydio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Pydio. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The latest code can be found at <https://pydio.com/>.
+ */
+
+$mess = [
+ "1" => "%s files queued for upload",
+ "2" => "Uploading %s files",
+ "3" => "You are not allowed to upload this file here",
+ "4" => "Pick File",
+ "5" => "Pick Folder",
+ "6" => "Cannot abort folder creation",
+ "7" => "Uploading files to server...",
+ "8" => "It seems that your browser does not support dropping folders",
+ "9" => "",
+ "10" => "",
+ "11" => "Start",
+ "12" => "Clear list",
+ "13" => "Folder created",
+ "14" => "Processing",
+ "15" => "Pending",
+ "16" => "Processed",
+ "17" => "Show/hide processed files",
+ "18" => "If a file with the same name exists:",
+ "19" => "Stop upload and alert me",
+ "20" => "Rename file automatically",
+ "21" => "Overwrite existing file silently",
+];
@@ -0,0 +1,44 @@
+<?php
+/*
+ * Copyright 2007-2016 Abstrium <contact (at) pydio.com>
+ * This file is part of Pydio.
+ *
+ * Pydio is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Pydio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Pydio. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The latest code can be found at <https://pydio.com/>.
+ */
+
+$mess = [
+ "1" => "%s fichiers en attente",
+ "2" => "Chargement de %s fichiers",
+ "3" => "Vous n'êtes pas autorisé à transférer ce fichier ici",
+ "4" => "Fichier",
+ "5" => "Répertoire",
+ "6" => "Impossible d'annuler la création d'un dossier",
+ "7" => "Transfert des fichiers vers le serveur...",
+ "8" => "Il semble que votre navigateur ne supporte pas le chargement de dossiers. Vous devriez utiliser l'application de synchronisation.",
+ "9" => "",
+ "10" => "",
+ "11" => "Démarrer",
+ "12" => "Vider",
+ "13" => "Répertoire créé",
+ "14" => "En cours",
+ "15" => "En attente",
+ "16" => "Terminés",
+ "17" => "Montrer/cacher les fichiers transferés",
+ "18" => "Si un fichier avec le même nom existe:",
+ "19" => "Interrompre et me demander",
+ "20" => "Renommer automatiquement",
+ "21" => "Remplacer le fichier existant",
+];
@@ -102,15 +102,15 @@
}
dataModel.applyCheckHook(newNode, params);
}catch(e){
- throw new Error('Error while checking before uploads');
+ throw new Error(global.pydio.MessageHash['html_uploader.3']);
}
let overwriteStatus = UploaderConfigs.getInstance().getOption("DEFAULT_EXISTING", "upload_existing");
if(overwriteStatus === 'rename'){
queryString += '&auto_rename=true';
}else if(overwriteStatus === 'alert' && !this._relativePath && currentRepo === this._repositoryId){
if(dataModel.fileNameExists(nodeName, false, this._targetNode)){
- if(!global.confirm(MessageHash[124])){
- throw new Error('File already exists');
+ if(!global.confirm(global.pydio.MessageHash[124])){
+ throw new Error(global.pydio.MessageHash[71]);
}
}
}
@@ -146,11 +146,6 @@
this.setStatus('loading');
let maxUpload = parseFloat(UploaderConfigs.getInstance().getOption('UPLOAD_MAX_SIZE'));
- if(this.getSize() > maxUpload){
- this.onError('File is too big: contact your admin to raise the upload value, or use the desktop client.');
- completeCallback();
- return;
- }
let queryString;
try{
@@ -166,11 +161,21 @@
this.tryAlternativeUpload(complete, progress, function(){
// Failed, switch back to normal upload.
+ if(this.getSize() > maxUpload){
+ this.onError(global.pydio.MessageHash[211]);
+ completeCallback();
+ return;
+ }
this.xhr = PydioApi.getClient().uploadFile(this._file,'userfile_0',queryString,complete,error,progress);
}.bind(this));
}else{
-
+
+ if(this.getSize() > maxUpload){
+ this.onError(global.pydio.MessageHash[211]);
+ completeCallback();
+ return;
+ }
this.xhr = PydioApi.getClient().uploadFile(this._file,'userfile_0',queryString,complete,error,progress);
}
@@ -251,7 +256,7 @@
}.bind(this));
}
_doAbort(completeCallback){
- if(global.console) global.console.log('Cannot abort folder creation');
+ if(global.console) global.console.log(global.pydio.MessageHash['html_uploader.6']);
}
}
@@ -263,7 +268,7 @@
userId : global.pydio.user.id,
wsId : global.pydio.user.activeRepository,
flags : PydioTasks.Task.FLAG_HAS_PROGRESS|PydioTasks.Task.FLAG_STOPPABLE,
- label : "Uploading files to server...",
+ label : global.pydio.MessageHash['html_uploader.7'],
status : PydioTasks.Task.STATUS_COMPLETE,
statusMessage : ''
});
@@ -274,11 +279,11 @@
this.updateStatus(PydioTasks.Task.STATUS_RUNNING);
}
setPending(queueSize){
- this._internal['statusMessage'] = queueSize + ' files waiting for upload';
+ this._internal['statusMessage'] = global.pydio.MessageHash['html_uploader.1'].replace('%s', queueSize);
this.updateStatus(PydioTasks.Task.STATUS_PENDING);
}
setRunning(queueSize){
- this._internal['statusMessage'] = 'Uploading ' + queueSize + ' files';
+ this._internal['statusMessage'] = global.pydio.MessageHash['html_uploader.2'].replace('%s', queueSize);
this.updateStatus(PydioTasks.Task.STATUS_RUNNING);
}
setIdle(){
@@ -514,7 +519,7 @@
for(var j=0;j<files.length;j++){
console.log(files[j]);
if(files[j].size === 0){
- alert('It seems that your browser does not support dropping folders.');
+ alert(global.pydio.MessageHash['html_uploader.8']);
return;
}
let uploadItem = new UploadItem(files[j], targetNode);
@@ -46,6 +46,8 @@
render: function(){
let options;
+ let messages = global.pydio.MessageHash;
+
if(this.state && this.state.options){
let dismiss = function(e){
this.toggleOptions(e);
@@ -59,21 +61,21 @@
let e = global.document.createElement('input');
e.setAttribute('type', 'file');
if('webkitdirectory' in e){
- folderButton = <ReactMUI.RaisedButton label="Pick Folder" onClick={this.openFolderPicker}/>;
+ folderButton = <ReactMUI.RaisedButton label={messages['html_uploader.5']} onClick={this.openFolderPicker}/>;
}
e = null;
let configs = UploaderModel.Configs.getInstance();
if(!configs.getOptionAsBool('DEFAULT_AUTO_START', 'upload_auto_send', true)){
- startButton = <ReactMUI.FlatButton label="Start" onClick={this.start} secondary={true}/>
+ startButton = <ReactMUI.FlatButton label={messages['html_uploader.11']} onClick={this.start} secondary={true}/>
}
return (
<div style={{position:'relative'}}>
<div className="react-mui-context uploader-action-bar">
<ReactMUI.FlatButton style={{float: 'right'}} label="Options" onClick={this.toggleOptions}/>
- <ReactMUI.RaisedButton secondary={true} label="Pick File" onClick={this.openFilePicker}/>
+ <ReactMUI.RaisedButton secondary={true} label={messages['html_uploader.4']} onClick={this.openFilePicker}/>
{folderButton}
{startButton}
- <ReactMUI.FlatButton label="Clear List" onClick={this.clear}/>
+ <ReactMUI.FlatButton label={messages['html_uploader.12']} onClick={this.clear}/>
</div>
<PydioForm.FileDropZone
ref="dropzone"
@@ -169,7 +171,7 @@
render: function(){
let statusMessage;
if(this.props.item.getStatus() === 'loaded'){
- statusMessage = 'Created';
+ statusMessage = global.pydio.MessageHash['html_uploader.13'];
}
return (
<div className={"folder-row upload-" + this.props.item.getStatus() + " " + (this.props.className?this.props.className:"")}>
@@ -226,9 +228,9 @@
render: function(){
let items = [];
if(this.state && this.state.items){
- this.renderSection(items, this.state.items.processing, 'Processing', 'section-processing');
- this.renderSection(items, this.state.items.pending, 'Pending', 'section-pending');
- this.renderSection(items, this.state.items.processed, 'Processed', 'section-processed');
+ this.renderSection(items, this.state.items.processing, global.pydio.MessageHash['html_uploader.14'], 'section-processing');
+ this.renderSection(items, this.state.items.pending, global.pydio.MessageHash['html_uploader.15'], 'section-pending');
+ this.renderSection(items, this.state.items.processed, global.pydio.MessageHash['html_uploader.16'], 'section-processed');
}
return (
<div id="upload_files_list" className={UploaderModel.Configs.getInstance().getOptionAsBool('UPLOAD_SHOW_PROCESSED', 'upload_show_processed', false) ? 'show-processed' : ''}>
@@ -279,8 +281,12 @@
render: function(){
- let maxUpload = this.state.configs.getOption('UPLOAD_MAX_SIZE');
- let maxUploadMessage = MessageHash[282] + ': ' + PathUtils.roundFileSize(maxUpload, '');
+ let maxUploadMessage
+ if(!global.pydio.getPluginConfigs('mq').get('UPLOAD_ACTIVE')){
+ let maxUpload = this.state.configs.getOption('UPLOAD_MAX_SIZE');
+ maxUploadMessage = global.pydio.MessageHash[282] + ': ' + PathUtils.roundFileSize(maxUpload, '');
+ maxUploadMessage = <div className="option-row">{maxUploadMessage}</div>;
+ }
let toggleStart = this.state.configs.getOptionAsBool('DEFAULT_AUTO_START', 'upload_auto_send');
let toggleClose = this.state.configs.getOptionAsBool('DEFAULT_AUTO_CLOSE', 'upload_auto_close');
let toggleShowProcessed = this.state.configs.getOptionAsBool('UPLOAD_SHOW_PROCESSED', 'upload_show_processed', false);
@@ -289,16 +295,16 @@
return (
<div className="upload-options-pane react-mui-context">
<span className="close-options mdi mdi-close" onClick={this.props.onDismiss}></span>
- <div className="option-row">{maxUploadMessage}</div>
- <div className="option-row"><ReactMUI.Toggle label="Start uploading automatically" labelPosition="right" toggled={toggleStart} defaultToggled={toggleStart} onToggle={this.updateField.bind(this, 'autostart')}/></div>
- <div className="option-row"><ReactMUI.Toggle label="Close panel after upload is finished" labelPosition="right" toggled={toggleClose} onToggle={this.updateField.bind(this, 'autoclose')}/></div>
- <div className="option-row"><ReactMUI.Toggle label="Show/hide processed files" labelPosition="right" toggled={toggleShowProcessed} onToggle={this.updateField.bind(this, 'show_processed')}/></div>
+ {maxUploadMessage}
+ <div className="option-row"><ReactMUI.Toggle label={global.pydio.MessageHash[337]} labelPosition="right" toggled={toggleStart} defaultToggled={toggleStart} onToggle={this.updateField.bind(this, 'autostart')}/></div>
+ <div className="option-row"><ReactMUI.Toggle label={global.pydio.MessageHash[338]} labelPosition="right" toggled={toggleClose} onToggle={this.updateField.bind(this, 'autoclose')}/></div>
+ <div className="option-row"><ReactMUI.Toggle label={global.pydio.MessageHash['html_uploader.17']} labelPosition="right" toggled={toggleShowProcessed} onToggle={this.updateField.bind(this, 'show_processed')}/></div>
<div className="option-row">
- <div style={{marginBottom: 10}}>If a file with the same name exists</div>
+ <div style={{marginBottom: 10}}>{global.pydio.MessageHash['html_uploader.18']}</div>
<ReactMUI.RadioButtonGroup ref="group" name="shipSpeed" defaultSelected={overwriteType} onChange={this.radioChange}>
- <ReactMUI.RadioButton value="alert" label="Stop upload and alert me"/>
- <ReactMUI.RadioButton value="rename" label="Rename new file automatically"/>
- <ReactMUI.RadioButton value="overwrite" label="Overwrite existing file"/>
+ <ReactMUI.RadioButton value="alert" label={global.pydio.MessageHash['html_uploader.19']}/>
+ <ReactMUI.RadioButton value="rename" label={global.pydio.MessageHash['html_uploader.20']}/>
+ <ReactMUI.RadioButton value="overwrite" label={global.pydio.MessageHash['html_uploader.21']}/>
</ReactMUI.RadioButtonGroup>
</div>
</div>

0 comments on commit 3385a4a

Please sign in to comment.