From 889ef47fd2bb8d0767bbabfcd49ee21db2744acd Mon Sep 17 00:00:00 2001 From: bjarnef Date: Fri, 24 Jun 2016 00:44:45 +0200 Subject: [PATCH] Update localization of listview bulk actions --- .../listview/listview.controller.js | 95 ++++++++----------- 1 file changed, 41 insertions(+), 54 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index 5f3810723a..e68cc71010 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -371,41 +371,34 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie applySelected( function (selected, index) { return deleteItemCallback(getIdCallback(selected[index])); }, function (count, total) { - return "Deleted " + count + " out of " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_deletedItemOfItem" : "bulk_deletedItemOfItems"); - //localizationService.localize(key, [count, total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_deletedItemOfItem" : "bulk_deletedItemOfItems"); + localizationService.localize(key, [count, total]).then(function (value) { + return value; + }); }, function (total) { - return "Deleted " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_deletedItem" : "bulk_deletedItems"); - //localizationService.localize(key, [total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_deletedItem" : "bulk_deletedItems"); + localizationService.localize(key, [total]).then(function (value) { + return value; + }); }, - //localizationService.localize("defaultdialogs_confirmdelete") + "?" - "Sure you want to delete?"); + localizationService.localize("defaultdialogs_confirmdelete") + "?"); }; $scope.publish = function () { applySelected( function (selected, index) { return contentResource.publishById(getIdCallback(selected[index])); }, function (count, total) { - return "Published " + count + " out of " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_publishedItemOfItem" : "bulk_publishedItemOfItems"); - //localizationService.localize(key, [count, total]).then(function (value) { - // console.log(key, value); - // return value; - //}); + var key = (total === 1 ? "bulk_publishedItemOfItem" : "bulk_publishedItemOfItems"); + localizationService.localize(key, [count, total]).then(function (value) { + return value; + }); }, function (total) { - return "Published " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_publishedItem" : "bulk_publishedItems"); - //localizationService.localize(key, [total]).then(function (value) { - // console.log(key, value); - // return value; - //}); + var key = (total === 1 ? "bulk_publishedItem" : "bulk_publishedItems"); + localizationService.localize(key, [total]).then(function (value) { + return value; + }); }); }; @@ -413,18 +406,16 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie applySelected( function (selected, index) { return contentResource.unPublish(getIdCallback(selected[index])); }, function (count, total) { - return "Unpublished " + count + " out of " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_unpublishedItemOfItem" : "bulk_unpublishedItemOfItems"); - //localizationService.localize(key, [count, total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_unpublishedItemOfItem" : "bulk_unpublishedItemOfItems"); + localizationService.localize(key, [count, total]).then(function (value) { + return value; + }); }, function (total) { - return "Unpublished " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_unpublishedItem" : "bulk_unpublishedItems"); - //localizationService.localize(key, [total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_unpublishedItem" : "bulk_unpublishedItems"); + localizationService.localize(key, [total]).then(function (value) { + return value; + }); }); }; @@ -458,18 +449,16 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie applySelected( function (selected, index) { return contentResource.move({ parentId: target.id, id: getIdCallback(selected[index]) }); }, function (count, total) { - return "Moved " + count + " out of " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_movedItemOfItem" : "bulk_movedItemOfItems"); - //localizationService.localize(key, [count, total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_movedItemOfItem" : "bulk_movedItemOfItems"); + localizationService.localize(key, [count, total]).then(function (value) { + return value; + }); }, function (total) { - return "Moved " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_movedItem" : "bulk_movedItems"); - //localizationService.localize(key, [total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_movedItem" : "bulk_movedItems"); + localizationService.localize(key, [total]).then(function (value) { + return value; + }); }); } @@ -501,18 +490,16 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie applySelected( function (selected, index) { return contentResource.copy({ parentId: target.id, id: getIdCallback(selected[index]), relateToOriginal: relateToOriginal }); }, function (count, total) { - return "Copied " + count + " out of " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_copiedItemOfItem" : "bulk_copiedItemOfItems"); - //localizationService.localize(key, [count, total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_copiedItemOfItem" : "bulk_copiedItemOfItems"); + localizationService.localize(key, [count, total]).then(function (value) { + return value; + }); }, function (total) { - return "Copied " + total + " item" + (total > 1 ? "s" : ""); - //var key = (total === 1 ? "bulk_copiedItem" : "bulk_copiedItems"); - //localizationService.localize(key, [total]).then(function (value) { - // return value; - //}); + var key = (total === 1 ? "bulk_copiedItem" : "bulk_copiedItems"); + localizationService.localize(key, [total]).then(function (value) { + return value; + }); }); }