Node.js based forum software built for the modern web
fixed up translation strings, closed #1278
Julian Lamef47fc78eb92
diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.jsonindex d9ed9e0bd9..1a38c9f776 100644--- a/public/language/en_GB/topic.json+++ b/public/language/en_GB/topic.json@@ -53,7 +53,14 @@"thread_tools.move": "Move Topic","thread_tools.fork": "Fork Topic","thread_tools.delete": "Delete Topic",+ "thread_tools.delete_confirm": "Are you sure you want to delete this thread?","thread_tools.restore": "Restore Topic",+ "thread_tools.restore_confirm": "Are you sure you want to restore this thread?",++ "post_delete_confirm": "Are you sure you want to delete this post?",+ "post_restore_confirm": "Are you sure you want to restore this post?",+ "post_delete_error": "Could not delete this post!",+ "post_restore_error": "Could not restore this post!","load_categories": "Loading Categories","disabled_categories_note": "Disabled Categories are greyed out",diff --git a/public/src/forum/topic/postTools.js b/public/src/forum/topic/postTools.jsindex 58e6406d29..399095b9c0 100644--- a/public/src/forum/topic/postTools.js+++ b/public/src/forum/topic/postTools.js@@ -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);+ }+ });+ }+ });});}diff --git a/public/src/forum/topic/threadTools.js b/public/src/forum/topic/threadTools.jsindex 46ca06e45d..0836b8d3b5 100644--- a/public/src/forum/topic/threadTools.js+++ b/public/src/forum/topic/threadTools.js@@ -15,11 +15,14 @@ define(['forum/topic/fork', 'forum/topic/move'], function(fork, move) {$('.delete_thread').on('click', function(e) {var command = threadState.deleted !== '1' ? 'delete' : 'restore';- bootbox.confirm('Are you sure you want to ' + command + ' this thread?', function(confirm) {- if (confirm) {- socket.emit('topics.' + command, tid);- }+ translator.translate('[[topic:thread_tools.' + command + '_confirm]]', function(msg) {+ bootbox.confirm(msg, function(confirm) {+ if (confirm) {+ socket.emit('topics.' + command, tid);+ }+ });});+return false;});