From e5106c830ddd4e94097e92c59d1ab179bc5a3ab1 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 29 May 2015 10:19:11 +0200 Subject: [PATCH] Issue 2762 - fix delete attribute lightbox translation --- app/coffee/modules/admin/project-values.coffee | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/coffee/modules/admin/project-values.coffee b/app/coffee/modules/admin/project-values.coffee index 22f7b7ce..ee520752 100644 --- a/app/coffee/modules/admin/project-values.coffee +++ b/app/coffee/modules/admin/project-values.coffee @@ -124,7 +124,7 @@ module.controller("ProjectValuesController", ProjectValuesController) ## Project values directive ############################################################################# -ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @translate, $rootscope) -> +ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, $translate, $rootscope) -> ## Drag & Drop Link linkDragAndDrop = ($scope, $el, $attrs) -> @@ -165,7 +165,7 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @tra } initializeTextTranslations = -> - $scope.addNewElementText = @translate.instant("ADMIN.PROJECT_VALUES_#{objName.toUpperCase()}.ACTION_ADD") + $scope.addNewElementText = $translate.instant("ADMIN.PROJECT_VALUES_#{objName.toUpperCase()}.ACTION_ADD") initializeNewValue() initializeTextTranslations() @@ -294,7 +294,10 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @tra if _.keys(choices).length == 0 return $confirm.error("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL") - $confirm.askChoice("PROJECT.TITLE_ACTION_DELETE_VALUE", subtitle, choices, "ADMIN.PROJECT_VALUES.REPLACEMENT").then (response) -> + title = $translate.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_VALUE") + text = $translate.instant("ADMIN.PROJECT_VALUES.REPLACEMENT") + + $confirm.askChoice(title, subtitle, choices, text).then (response) -> onSucces = -> $ctrl.loadValues().finally -> response.finish() @@ -428,7 +431,7 @@ module.controller("ProjectCustomAttributesController", ProjectCustomAttributesCo ## Custom Attributes Directive ############################################################################# -ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) -> +ProjectCustomAttributesDirective = ($log, $confirm, animationFrame, $translate) -> link = ($scope, $el, $attrs) -> $ctrl = $el.controller() @@ -614,7 +617,10 @@ ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) -> attr = formEl.scope().attr message = attr.name - $confirm.ask("COMMON.CUSTOM_ATTRIBUTES.DELETE", "COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE", message).then (finish) -> + title = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.DELETE") + text = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE") + + $confirm.ask(title, text, message).then (finish) -> onSucces = -> $ctrl.loadCustomAttributes().finally -> finish() @@ -634,4 +640,4 @@ ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) -> return {link: link} -module.directive("tgProjectCustomAttributes", ["$log", "$tgConfirm", "animationFrame", ProjectCustomAttributesDirective]) +module.directive("tgProjectCustomAttributes", ["$log", "$tgConfirm", "animationFrame", "$translate", ProjectCustomAttributesDirective])