mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
closes #1539
This commit is contained in:
@@ -5,5 +5,8 @@
|
|||||||
"chat.no_active": "You have no active chats.",
|
"chat.no_active": "You have no active chats.",
|
||||||
"chat.user_typing": "%1 is typing ...",
|
"chat.user_typing": "%1 is typing ...",
|
||||||
"chat.user_has_messaged_you": "%1 has messaged you.",
|
"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"
|
||||||
}
|
}
|
||||||
@@ -108,19 +108,25 @@ define(['taskbar', 'composer/controls', 'composer/uploads', 'composer/formatting
|
|||||||
var uuid = composer.active;
|
var uuid = composer.active;
|
||||||
|
|
||||||
if(uuid === undefined){
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var bodyEl = $('#cmp-uuid-'+uuid).find('textarea');
|
var bodyEl = $('#cmp-uuid-'+uuid).find('textarea');
|
||||||
var prevText = bodyEl.val();
|
var prevText = bodyEl.val();
|
||||||
if(tid !== composer.posts[uuid].tid) {
|
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 {
|
} else {
|
||||||
text = username + ' said:\n' + text;
|
translator.translate('[[modules:composer.user_said, ' + username + ']]', onTranslated);
|
||||||
}
|
}
|
||||||
composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + text;
|
|
||||||
|
function onTranslated(translated) {
|
||||||
|
composer.posts[uuid].body = (prevText.length ? prevText + '\n\n' : '') + translated + text;
|
||||||
bodyEl.val(composer.posts[uuid].body);
|
bodyEl.val(composer.posts[uuid].body);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
composer.newReply = function(tid, pid, title, text) {
|
composer.newReply = function(tid, pid, title, text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user