From c8f3632fa4ac25ec227c7fa72b65e08c6b4913b1 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 6 Jun 2014 22:00:18 -0400 Subject: [PATCH] added new english strings for GUI --- onionshare/strings.json | 7 ++++++- onionshare_gui/static/onionshare.js | 11 +++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/onionshare/strings.json b/onionshare/strings.json index f89102bc..2064824b 100644 --- a/onionshare/strings.json +++ b/onionshare/strings.json @@ -8,7 +8,12 @@ "ctrlc_to_stop": "Press Ctrl-C to stop server", "not_a_file": "{0} is not a file.", "filesize": "File size", - "sha1_checksum": "SHA1 checksum" + "sha1_checksum": "SHA1 checksum", + "copied_url": "Copied URL to clipboard", + "download_page_loaded": "Download page loaded", + "download_started": "Download started", + "download_finished": "Download finished", + "other_page_loaded": "Other page has been loaded" }, "no": { "punching_a_hole": "Ã…pner port i brannmuren.", "closing_hole": "Lukker port i brannmuren.", diff --git a/onionshare_gui/static/onionshare.js b/onionshare_gui/static/onionshare.js index 09c3cc12..d30b7fc1 100644 --- a/onionshare_gui/static/onionshare.js +++ b/onionshare_gui/static/onionshare.js @@ -17,7 +17,7 @@ $(function(){ $.ajax({ url: '/copy_url', success: function(data, textStatus, jqXHR){ - update('Copied secret URL to clipboard'); + update(onionshare.strings['copied_url']); } }); } @@ -33,12 +33,12 @@ $(function(){ if(data != '') { var r = JSON.parse(data); if(r.type == REQUEST_LOAD) { - update($('').addClass('weblog').html('Download page loaded')); + update($('').addClass('weblog').html(onionshare.strings['download_page_loaded'])); } else if(r.type == REQUEST_DOWNLOAD) { - update($('').addClass('weblog').html('Download started')); + update($('').addClass('weblog').html(onionshare.strings['download_started'])); } else { if(r.path != '/favicon.ico') - update($('').addClass('weblog-error').html('Other page has been loaded: {0}'.replace('{0}', r.path))); + update($('').addClass('weblog-error').html(onionshare.strings['other_page_loaded']+': '+r.path)); } } @@ -54,8 +54,7 @@ $(function(){ onionshare = JSON.parse(data); $('#basename').html(onionshare.basename); - update("Sharing file: "+onionshare.basename+" ("+onionshare.filesize+" bytes)"); - update("SHA1 checksum: "+onionshare.filehash); + update(onionshare.strings['sha1_checksum']+": "+onionshare.filehash); linebreak(); update(onionshare.strings['give_this_url']); update($('').html(onionshare.url));