From ed8fd002c53800b966fc1ef6115c2ff53fa042b1 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Wed, 8 Apr 2015 21:30:53 -0300 Subject: Removes argument fixing of the i18n library #66 To introduce variables on the internationalization functions we should be able to pass extra arguments to the `i18n.t`. The way it was we could only pass the key and no more options to interpolate values. --- web-ui/app/js/helpers/view_helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui/app/js/helpers') diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index 6755b891..cf4406bb 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -22,7 +22,7 @@ define( 'quoted-printable/quoted-printable', 'utf8/utf8' ], - function(contentType, htmlWhitelister, i18n_lib, quotedPrintable, utf8) { + function(contentType, htmlWhitelister, i18n, quotedPrintable, utf8) { 'use strict'; function formatStatusClasses(ss) { -- cgit v1.2.3 From d3c86f867d29b79eec1d280389975c920a7ec196 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Wed, 8 Apr 2015 21:39:22 -0300 Subject: Prepend mail quoting with the sender information #66 --- web-ui/app/js/helpers/view_helper.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'web-ui/app/js/helpers') diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index cf4406bb..a682ae5e 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -109,12 +109,15 @@ define( }, 1); } - function quoteMail(mail) { - return '\n\n' + mail.textPlainBody.replace(/^/mg, '> '); + function prependFrom(mail) { + return i18n( + 'On __date__, <__from__> wrote:\n', + {'date': new Date(mail.header.date).toString(), 'from': mail.header.from} + ); } - function i18n(text) { - return i18n_lib.get(text); + function quoteMail(mail) { + return '\n\n' + prependFrom(mail) + mail.textPlainBody.replace(/^/mg, '> '); } return { -- cgit v1.2.3