fixed up translation strings, closed #1278

This commit is contained in:
Julian Lam
2014-04-02 10:29:42 -04:00
parent fa6d6816e4
commit ef47fc78eb
3 changed files with 27 additions and 15 deletions

View File

@@ -143,17 +143,19 @@ define(['composer', 'share'], function(composer, share) {
postEl = $(document.querySelector('#post-container li[data-pid="' + pid + '"]')),
action = !postEl.hasClass('deleted') ? 'delete' : 'restore';
bootbox.confirm('Are you sure you want to ' + action + ' this post?', function(confirm) {
if (confirm) {
socket.emit('posts.' + action, {
pid: pid,
tid: tid
}, function(err) {
if(err) {
return app.alertError('Can\'t ' + action + ' post!');
}
});
}
translator.translate('[[topic:post_' + action + '_confirm]]', function(msg) {
bootbox.confirm(msg, function(confirm) {
if (confirm) {
socket.emit('posts.' + action, {
pid: pid,
tid: tid
}, function(err) {
if(err) {
return translator.translate('[[topic:post_' + action + '_error]]', app.alertError);
}
});
}
});
});
}