mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
closes #1539
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user