diff --git a/public/src/app.js b/public/src/app.js index b42fc1e211..c3376caf65 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -344,24 +344,26 @@ var socket, app.createNewPosts = function (data) { data.posts[0].display_moderator_tools = 'none'; - var html = templates.prepare(templates['topic'].blocks['posts']).parse(data), - uniqueid = new Date().getTime(), - tempContainer = jQuery('
') - .appendTo("#post-container") - .hide() - .append(html) - .fadeIn('slow'); - - for (var x = 0, numPosts = data.posts.length; x < numPosts; x++) { - socket.emit('api:post.privileges', data.posts[x].pid); - } + var html = templates.prepare(templates['topic'].blocks['posts']).parse(data); + translator.translate(html, function(translatedHTML) { + var uniqueid = new Date().getTime(), + tempContainer = jQuery('
') + .appendTo("#post-container") + .hide() + .append(translatedHTML) + .fadeIn('slow'); + + for (var x = 0, numPosts = data.posts.length; x < numPosts; x++) { + socket.emit('api:post.privileges', data.posts[x].pid); + } - tempContainer.replaceWith(tempContainer.contents()); - infiniteLoaderActive = false; + tempContainer.replaceWith(tempContainer.contents()); + infiniteLoaderActive = false; - app.populate_online_users(); - app.addCommasToNumbers(); - $('span.timeago').timeago(); + app.populate_online_users(); + app.addCommasToNumbers(); + $('span.timeago').timeago(); + }); } app.infiniteLoaderActive = false;