From 9f760f9b558543267f9c975c846738930a181339 Mon Sep 17 00:00:00 2001 From: pichalite Date: Fri, 19 Feb 2016 21:08:40 +0000 Subject: [PATCH 1/3] translate string in groups --- public/src/client/groups/list.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/public/src/client/groups/list.js b/public/src/client/groups/list.js index 4293d0de69..2b3f2bf468 100644 --- a/public/src/client/groups/list.js +++ b/public/src/client/groups/list.js @@ -1,7 +1,7 @@ "use strict"; /* globals app, define, ajaxify, socket, bootbox, utils, templates */ -define('forum/groups/list', ['forum/infinitescroll'], function(infinitescroll) { +define('forum/groups/list', ['forum/infinitescroll', 'translator'], function(infinitescroll, translator) { var Groups = {}; Groups.init = function() { @@ -17,18 +17,20 @@ define('forum/groups/list', ['forum/infinitescroll'], function(infinitescroll) { // Group creation $('button[data-action="new"]').on('click', function() { - bootbox.prompt('[[group:new-group.group_name]]', function(name) { - if (name && name.length) { - socket.emit('groups.create', { - name: name - }, function(err) { - if (!err) { - ajaxify.go('groups/' + utils.slugify(name)); - } else { - app.alertError(err.message); - } - }); - } + translator.translate('[[groups:new-group.group_name]]', function(translated) { + bootbox.prompt(translated, function(name) { + if (name && name.length) { + socket.emit('groups.create', { + name: name + }, function(err) { + if (!err) { + ajaxify.go('groups/' + utils.slugify(name)); + } else { + app.alertError(err.message); + } + }); + } + }); }); }); var params = utils.params(); From 872b33f0cc8e29ad6a85fe65a57a252533ae5f54 Mon Sep 17 00:00:00 2001 From: pichalite Date: Mon, 22 Feb 2016 10:46:10 -0800 Subject: [PATCH 2/3] fix typo --- public/src/client/groups/list.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/public/src/client/groups/list.js b/public/src/client/groups/list.js index 2b3f2bf468..40d31b5556 100644 --- a/public/src/client/groups/list.js +++ b/public/src/client/groups/list.js @@ -17,20 +17,18 @@ define('forum/groups/list', ['forum/infinitescroll', 'translator'], function(inf // Group creation $('button[data-action="new"]').on('click', function() { - translator.translate('[[groups:new-group.group_name]]', function(translated) { - bootbox.prompt(translated, function(name) { - if (name && name.length) { - socket.emit('groups.create', { - name: name - }, function(err) { - if (!err) { - ajaxify.go('groups/' + utils.slugify(name)); - } else { - app.alertError(err.message); - } - }); - } - }); + bootbox.prompt('[[groups:new-group.group_name]]', function(name) { + if (name && name.length) { + socket.emit('groups.create', { + name: name + }, function(err) { + if (!err) { + ajaxify.go('groups/' + utils.slugify(name)); + } else { + app.alertError(err.message); + } + }); + } }); }); var params = utils.params(); @@ -98,4 +96,4 @@ define('forum/groups/list', ['forum/infinitescroll', 'translator'], function(inf }; return Groups; -}); \ No newline at end of file +}); From fba4e93cfeac44684c557e3aad9e1014bd930eb0 Mon Sep 17 00:00:00 2001 From: pichalite Date: Mon, 22 Feb 2016 10:47:29 -0800 Subject: [PATCH 3/3] remove translator --- public/src/client/groups/list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/groups/list.js b/public/src/client/groups/list.js index 40d31b5556..7d444bfd87 100644 --- a/public/src/client/groups/list.js +++ b/public/src/client/groups/list.js @@ -1,7 +1,7 @@ "use strict"; /* globals app, define, ajaxify, socket, bootbox, utils, templates */ -define('forum/groups/list', ['forum/infinitescroll', 'translator'], function(infinitescroll, translator) { +define('forum/groups/list', ['forum/infinitescroll'], function(infinitescroll) { var Groups = {}; Groups.init = function() {