From 8c4cb90b3a9e23e386546473c5f1cdb2f8d7ccb7 Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Wed, 19 Jul 2017 09:04:27 -0700 Subject: [PATCH] finished l10n --- frontend/src/download.js | 14 +++++++++----- public/locales/send.en-US.ftl | 2 ++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/src/download.js b/frontend/src/download.js index b19d9078..1fe6f7d5 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -47,8 +47,11 @@ $(document).ready(function() { //on complete if (percent === 1) { fileReceiver.removeAllListeners('progress'); - notify('Your download has finished.'); - $('.title').html('Download Complete'); + document.l10n.formatValues('downloadNotification', 'downloadFinish') + .then(translated => { + notify(translated[0]); + $('.title').html(translated[1]); + }) } }); @@ -73,9 +76,10 @@ $(document).ready(function() { fileReceiver .download() .catch(() => { - $('.title').text( - 'This link has expired or never existed in the first place.' - ); + document.l10n.formatValue('expiredPageHeader') + .then(translated => { + $('.title').text(translated); + }) $('#download-btn').hide(); $('#expired-img').show(); console.log('The file has expired, or has already been deleted.'); diff --git a/public/locales/send.en-US.ftl b/public/locales/send.en-US.ftl index 21667a31..de26db46 100644 --- a/public/locales/send.en-US.ftl +++ b/public/locales/send.en-US.ftl @@ -45,6 +45,8 @@ downloadFileSize = ({ $size }) downloadMessage = Your friend is sending you a file with Firefox Send, a service that allows you to share files with a safe, private, and encrypted link that automatically expires to ensure your stuff does not remain online forever. downloadButtonLabel = Download .title = {downloadButtonLabel} +downloadNotification = Your download has completed. +downloadFinish = Download Complete sendYourFilesLink = Try Firefox Send .title = {sendYourFilesLink}