From 36ed21ad72f999a2352a812f5849ad9dacd77db6 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 23 Jun 2014 18:47:52 -0400 Subject: [PATCH] closes #1739 --- public/src/forum/topic/postTools.js | 2 +- public/src/modules/composer.js | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/public/src/forum/topic/postTools.js b/public/src/forum/topic/postTools.js index 186221c0a9..cdb44dc5e4 100644 --- a/public/src/forum/topic/postTools.js +++ b/public/src/forum/topic/postTools.js @@ -140,7 +140,7 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator'], function(com if($('.composer').length) { composer.addQuote(tid, pid, topicName, username, quoted); } else { - composer.newReply(tid, pid, topicName, username + ' said:\n' + quoted); + composer.newReply(tid, pid, topicName, '[[modules:composer.user_said, ' + username + ']]' + quoted); } }); } diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 0b06e711dd..a58dc5920e 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -118,9 +118,7 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting var uuid = composer.active; if(uuid === undefined){ - translator.translate('[[modules:composer.user_said, ' + username + ']]', function(translated) { - composer.newReply(tid, pid, title, translated + text); - }); + composer.newReply(tid, pid, title, '[[modules:composer.user_said, ' + username + ']]' + text); return; } @@ -136,17 +134,20 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting function onTranslated(translated) { composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + translated + text; bodyEl.val(composer.posts[uuid].body); + preview.render($('#cmp-uuid-' + uuid)); } }; composer.newReply = function(tid, pid, title, text) { - push({ - tid: tid, - toPid: pid, - title: title, - body: text, - modified: false, - isMain: false + translator.translate(text, function(translated) { + push({ + tid: tid, + toPid: pid, + title: title, + body: translated, + modified: false, + isMain: false + }); }); };