diff --git a/public/src/admin/admin.js b/public/src/admin/admin.js index add13c30cc..5647f8b2d7 100644 --- a/public/src/admin/admin.js +++ b/public/src/admin/admin.js @@ -1,5 +1,5 @@ "use strict"; -/*global config, translator, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/ +/*global config, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/ (function() { var logoutTimer = 0; diff --git a/public/src/admin/appearance/themes.js b/public/src/admin/appearance/themes.js index 901f64b688..0d4e403fbd 100644 --- a/public/src/admin/appearance/themes.js +++ b/public/src/admin/appearance/themes.js @@ -76,9 +76,11 @@ define('admin/appearance/themes', function() { templates.parse('admin/partials/theme_list', { themes: themes }, function(html) { - translator.translate(html, function(html) { - instListEl.html(html); - highlightSelectedTheme(config['theme:id']); + require(['translator'], function(translator) { + translator.translate(html, function(html) { + instListEl.html(html); + highlightSelectedTheme(config['theme:id']); + }); }); }); } diff --git a/public/src/client/topic/flag.js b/public/src/client/topic/flag.js index 3101c0cd1c..9d07330289 100644 --- a/public/src/client/topic/flag.js +++ b/public/src/client/topic/flag.js @@ -1,6 +1,6 @@ 'use strict'; -/* globals define, app, socket, templates, translator */ +/* globals define, app, socket, templates */ define('forum/topic/flag', [], function() { @@ -34,7 +34,9 @@ define('forum/topic/flag', [], function() { function parseModal(callback) { templates.parse('partials/modals/flag_post_modal', {}, function(html) { - translator.translate(html, callback); + require(['translator'], function(translator) { + translator.translate(html, callback); + }); }); } diff --git a/public/src/client/topic/move.js b/public/src/client/topic/move.js index d16eb9bc41..336ea40870 100644 --- a/public/src/client/topic/move.js +++ b/public/src/client/topic/move.js @@ -1,6 +1,6 @@ 'use strict'; -/* globals define, app, socket, templates, translator */ +/* globals define, app, socket, templates */ define('forum/topic/move', function() { @@ -46,14 +46,16 @@ define('forum/topic/move', function() { function parseModal(categories, callback) { templates.parse('partials/move_thread_modal', {categories: []}, function(html) { - translator.translate(html, function(html) { - modal = $(html); - categories.forEach(function(category) { - if (!category.link) { - buildRecursive(modal.find('.category-list'), category, ''); - } + require(['translator'], function(translator) { + translator.translate(html, function(html) { + modal = $(html); + categories.forEach(function(category) { + if (!category.link) { + buildRecursive(modal.find('.category-list'), category, ''); + } + }); + callback(); }); - callback(); }); }); }