diff --git a/public/language/en_GB/modules.json b/public/language/en_GB/modules.json index b1d1903a79..88a787af4f 100644 --- a/public/language/en_GB/modules.json +++ b/public/language/en_GB/modules.json @@ -5,5 +5,8 @@ "chat.no_active": "You have no active chats.", "chat.user_typing": "%1 is typing ...", "chat.user_has_messaged_you": "%1 has messaged you.", - "chat.see_all": "See all Chats" + "chat.see_all": "See all Chats", + + "composer.user_said_in": "%1 said in %2:\n", + "composer.user_said": "%1 said:\n" } \ No newline at end of file diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 55cd73e20d..dea4246bc2 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -108,19 +108,25 @@ define(['taskbar', 'composer/controls', 'composer/uploads', 'composer/formatting var uuid = composer.active; if(uuid === undefined){ - composer.newReply(tid, pid, title, username + ' said:\n' + text); + translator.translate('[[modules:composer.user_said, ' + username + ']]', function(translated) { + composer.newReply(tid, pid, title, translated + text); + }); return; } var bodyEl = $('#cmp-uuid-'+uuid).find('textarea'); var prevText = bodyEl.val(); if(tid !== composer.posts[uuid].tid) { - text = username + ' said in ['+title+'](/topic/'+tid+'#'+pid+'):\n'+text; + var link = '[' + title + '](/topic/' + tid + '#' + pid + ')'; + translator.translate('[[modules:composer.user_said_in, ' + username + ', ' + link + ']]', onTranslated); } else { - text = username + ' said:\n' + text; + translator.translate('[[modules:composer.user_said, ' + username + ']]', onTranslated); + } + + function onTranslated(translated) { + composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + translated + text; + bodyEl.val(composer.posts[uuid].body); } - composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + text; - bodyEl.val(composer.posts[uuid].body); }; composer.newReply = function(tid, pid, title, text) {