diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index c6ae72ce5..10efcb2df 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -347,6 +347,10 @@ define(function () { out.settings_logoutEverywhere = "Log out of all other web sessions"; out.settings_logoutEverywhereConfirm = "Are you sure? You will need to log in with all your devices."; + out.upload_serverError = "Server Error: unable to upload your file at this time."; + out.upload_uploadPending = "You already have an upload in progress. Cancel it and upload your new file?"; + out.upload_success = "Your file ({0}) has been successfully uploaded and added to your drive"; + // index.html diff --git a/www/file/main.js b/www/file/main.js index e8eae01ae..2f75edb9a 100644 --- a/www/file/main.js +++ b/www/file/main.js @@ -89,7 +89,7 @@ define([ var defaultName = Cryptpad.getDefaultName(Cryptpad.parsePadUrl(window.location.href)); Title.updateTitle(title || defaultName); APP.toolbar.title.show(); - Cryptpad.alert("successfully uploaded: " + title); + Cryptpad.alert(Messages._getKey('upload_success', [title])); }); }); }; @@ -97,15 +97,16 @@ define([ Cryptpad.rpc.send('UPLOAD_STATUS', estimate, function (e, pending) { if (e) { console.error(e); - return void Cryptpad.alert("something went wrong"); // TODO translate + return void Cryptpad.alert(Messages.upload_serverError); } if (pending[0]) { - return void Cryptpad.confirm('upload pending, abort?', function (yes) { // TODO translate + return void Cryptpad.confirm(Messages.upload_uploadPending, function (yes) { if (!yes) { return; } Cryptpad.rpc.send('UPLOAD_CANCEL', '', function (e, res) { if (e) { return void console.error(e); } console.log(res); + next(again); }); }); }