From 90f83f9694a59e3b04ae770b4efed8402efbce47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Mon, 11 May 2015 16:13:48 +0200 Subject: [PATCH] [i18n] Fix importer project errors --- app/coffee/modules/resources/projects.coffee | 14 +++++++++++--- app/locales/locale-ca.json | 4 +++- app/locales/locale-en.json | 2 ++ app/locales/locale-es.json | 2 ++ app/locales/locale-fi.json | 2 ++ app/locales/locale-fr.json | 2 ++ app/locales/locale-zh-hant.json | 2 ++ 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/resources/projects.coffee b/app/coffee/modules/resources/projects.coffee index 323b674c..ad712d42 100644 --- a/app/coffee/modules/resources/projects.coffee +++ b/app/coffee/modules/resources/projects.coffee @@ -85,17 +85,25 @@ resourceProvider = ($config, $repo, $http, $urls, $auth, $q, $translate) -> maxFileSize = $config.get("maxUploadFileSize", null) if maxFileSize and file.size > maxFileSize + errorMsg = $translate.instant("PROJECT.IMPORT.ERROR_MAX_SIZE_EXCEEDED", { + fileName: file.name + fileSize: sizeFormat(file.size) + maxFileSize: sizeFormat(maxFileSize) + }) + response = { status: 413, - data: _error_message: "'#{file.name}' (#{sizeFormat(file.size)}) is too heavy for our oompa - loompas, try it with a smaller than (#{sizeFormat(maxFileSize)})" + data: _error_message: errorMsg } defered.reject(response) return defered.promise uploadProgress = (evt) => percent = Math.round((evt.loaded / evt.total) * 100) - message = "Uloaded #{sizeFormat(evt.loaded)} of #{sizeFormat(evt.total)}" + message = $translate.instant("PROJECT.IMPORT.UPLOAD_IN_PROGRESS_MESSAGE", { + uploadedSize: sizeFormat(evt.loaded) + totalSize: sizeFormat(evt.total) + }) statusUpdater("in-progress", null, message, percent) uploadComplete = (evt) => diff --git a/app/locales/locale-ca.json b/app/locales/locale-ca.json index 2c800f8d..55b0aaab 100644 --- a/app/locales/locale-ca.json +++ b/app/locales/locale-ca.json @@ -476,9 +476,11 @@ "DESCRIPTION": "Aquest procés pot durar una mica, pero favor mantinga la finestra oberta", "ASYNC_IN_PROGRESS_TITLE": "Els Oompa Loompas estàn important el teu projecte", "ASYNC_IN_PROGRESS_MESSAGE": "Aquest procés pot durar uns moments
T'enviarem un correo quan estiga llest.", + "UPLOAD_IN_PROGRESS_MESSAGE": "Uploaded {{uploadedSize}} of {{totalSize}}", "ERROR": "Els Oompa Loompas han tingut problemes pujan les teues dades. Per favor intenta-ho de nou.", "ERROR_TOO_MANY_REQUEST": "Ho sentim, els Oompa Loompas estàn molt ocupats ara mateix. Intenta-ho de nou en uns moments.", "ERROR_MESSAGE": "Els Oompa Loompas tenen problemes important les teues dades: {{error_message}}", + "ERROR_MAX_SIZE_EXCEEDED": "'{{fileName}}' ({{fileSize}}) is too heavy for our Oompa Loompas, try it with a smaller than ({{maxFileSize}})", "SYNC_SUCCESS": "El teu projecte s'ha importat correctament" } }, @@ -792,7 +794,7 @@ "PLACEHOLDER_FIELD": "Mot d'usuari i correu", "ACTION_RESET_PASSWORD": "Resetejar contrasenya", "LINK_CANCEL": "No, portam enrere, crec que ho recorde.", - "SUCCESS": "Check your inbox!
We have sent you an email with the instructions to set a new password", + "SUCCESS": "Mira el teu correu!
Hem enviat un correu amb les instrucciones per a setejar una nova contrasenya.", "ERROR": "Segons els nostres Oompa Loompas, no estàs registrat encara." }, "LOGIN_COMMON": { diff --git a/app/locales/locale-en.json b/app/locales/locale-en.json index 8ed6e8b6..51de880b 100644 --- a/app/locales/locale-en.json +++ b/app/locales/locale-en.json @@ -476,9 +476,11 @@ "DESCRIPTION": "This process can take a while, please keep the window open.", "ASYNC_IN_PROGRESS_TITLE": "Our Oompa Loompas are importing your project", "ASYNC_IN_PROGRESS_MESSAGE": "This process could take a few minutes
We will send you an email when ready", + "UPLOAD_IN_PROGRESS_MESSAGE": "Uploaded {{uploadedSize}} of {{totalSize}}", "ERROR": "Our Oompa Loompas have some problems importing your dump data. Please try again.", "ERROR_TOO_MANY_REQUEST": "Sorry, our Oompa Loompas are very busy right now. Please try again in a few minutes.", "ERROR_MESSAGE": "Our Oompa Loompas have some problems importing your dump data: {{error_message}}", + "ERROR_MAX_SIZE_EXCEEDED": "'{{fileName}}' ({{fileSize}}) is too heavy for our Oompa Loompas, try it with a smaller than ({{maxFileSize}})", "SYNC_SUCCESS": "Your project has been imported successfuly" } }, diff --git a/app/locales/locale-es.json b/app/locales/locale-es.json index 31ceb5fb..65c295c9 100644 --- a/app/locales/locale-es.json +++ b/app/locales/locale-es.json @@ -476,9 +476,11 @@ "DESCRIPTION": "Este proceso puede tardar un ratito, por favor mantén la ventana abierta.", "ASYNC_IN_PROGRESS_TITLE": "Nuestros Oompa Loompa están importando su proyecto", "ASYNC_IN_PROGRESS_MESSAGE": "Este proceso puede llevarnos algún tiempo
Te enviaremos un email cuando esté listo", + "UPLOAD_IN_PROGRESS_MESSAGE": "Subidos {{uploadedSize}} de {{totalSize}}", "ERROR": "Nuestros Oompa Loompas tienen problemas para importar tus datos. Por favor inténtalo nuevamente.", "ERROR_TOO_MANY_REQUEST": "Lo sentimos, nuestros Oompa Loompas están muy ocupados en este momento. Por favor inténtalo nuevamente en unos minutos.", "ERROR_MESSAGE": "Nuestros Oompa Loompas tienen algunos problemas importando tus datos: {{error_message}}", + "ERROR_MAX_SIZE_EXCEEDED": "El fichero '{{fileName}}' ({{fileSize}}) es demasiado pesado para nuestros Oompa Loompas, prueba con uno de menos de ({{maxFileSize}}).", "SYNC_SUCCESS": "Tu proyecto se ha importado con éxito." } }, diff --git a/app/locales/locale-fi.json b/app/locales/locale-fi.json index 827e11a2..6bb27dc4 100644 --- a/app/locales/locale-fi.json +++ b/app/locales/locale-fi.json @@ -476,9 +476,11 @@ "DESCRIPTION": "Tämä voi kestää hetken, pidä ikkuna auki.", "ASYNC_IN_PROGRESS_TITLE": " Oompa Loompas tuovat projektia", "ASYNC_IN_PROGRESS_MESSAGE": "Tämä voi kestää muutaman minuutin
Lähetämme sähköpostin on valmista", + "UPLOAD_IN_PROGRESS_MESSAGE": "Uploaded {{uploadedSize}} of {{totalSize}}", "ERROR": "Oompa Loompas eivät onnistuneet tuomaan tiedostoasi. Yritä uudestaan.", "ERROR_TOO_MANY_REQUEST": "Oompa Loompas ovat kiireisiä juuri nyt. Yritä hetken päästä uudelleen.", "ERROR_MESSAGE": "Oompa Loompas eivät pysty lukemaan tiedostoasi: {{error_message}}", + "ERROR_MAX_SIZE_EXCEEDED": "'{{fileName}}' ({{fileSize}}) is too heavy for our Oompa Loompas, try it with a smaller than ({{maxFileSize}})", "SYNC_SUCCESS": "Projektisi on tuotu sisään onnistuneesti" } }, diff --git a/app/locales/locale-fr.json b/app/locales/locale-fr.json index a6911c7d..26db18e7 100644 --- a/app/locales/locale-fr.json +++ b/app/locales/locale-fr.json @@ -476,9 +476,11 @@ "DESCRIPTION": "Ce processus peut prendre du temps, veuillez garder cette fenêtre ouverte.", "ASYNC_IN_PROGRESS_TITLE": "Nos Oompas Loompas sont en train d'importer votre projet", "ASYNC_IN_PROGRESS_MESSAGE": "Ce processus pourrait durer plusieurs minutes
Nous vous enverrons un emai quand ce sera prêt", + "UPLOAD_IN_PROGRESS_MESSAGE": "Uploaded {{uploadedSize}} of {{totalSize}}", "ERROR": "Nos Oompas Loompas ont rencontré des problèmes en important votre dump de données. Merci de réessayer.", "ERROR_TOO_MANY_REQUEST": "Nous sommes désolés, nos oompa loompas sont très occupés en ce moment. Veuillez réessayer dans quelques minutes.", "ERROR_MESSAGE": "Nos oompa loompas ont des problèmes pour importer le dump de vos données : {{error_message}}", + "ERROR_MAX_SIZE_EXCEEDED": "'{{fileName}}' ({{fileSize}}) is too heavy for our Oompa Loompas, try it with a smaller than ({{maxFileSize}})", "SYNC_SUCCESS": "Votre projet a été importé avec succès" } }, diff --git a/app/locales/locale-zh-hant.json b/app/locales/locale-zh-hant.json index 38df8d4f..cc4f5a69 100644 --- a/app/locales/locale-zh-hant.json +++ b/app/locales/locale-zh-hant.json @@ -476,9 +476,11 @@ "DESCRIPTION": "這個過桯要花點時間,請保持视窗開啟", "ASYNC_IN_PROGRESS_TITLE": "我們的工程師對你的專案很重要哦", "ASYNC_IN_PROGRESS_MESSAGE": "這個過程要花上一點時間
當弄好時我們會發給你一封郵件", + "UPLOAD_IN_PROGRESS_MESSAGE": "Uploaded {{uploadedSize}} of {{totalSize}}", "ERROR": "系統在滙進你倒入的資料時遇上一些問題,請再試一次", "ERROR_TOO_MANY_REQUEST": "抱歉系統繁忙中,請稍後再試試 ", "ERROR_MESSAGE": "我們的系統無法滙入你的資料", + "ERROR_MAX_SIZE_EXCEEDED": "'{{fileName}}' ({{fileSize}}) is too heavy for our Oompa Loompas, try it with a smaller than ({{maxFileSize}})", "SYNC_SUCCESS": "你的專案已成功滙入" } },