From 3df56befc90a6535a5c59a4002f836738248b4d1 Mon Sep 17 00:00:00 2001 From: Romina Suarez Date: Tue, 19 Jun 2018 17:48:00 -0300 Subject: [PATCH] fix(SavedSearch Editor) name and description should be translated in the directive js, not in the html. #3086 --- app/main/posts/savedsearches/editor-directive.js | 6 +++++- app/main/posts/savedsearches/savedsearch-editor.html | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/main/posts/savedsearches/editor-directive.js b/app/main/posts/savedsearches/editor-directive.js index 6317ece44c..c4a6cc8019 100644 --- a/app/main/posts/savedsearches/editor-directive.js +++ b/app/main/posts/savedsearches/editor-directive.js @@ -1,5 +1,6 @@ module.exports = [ '$q', + '$filter', '$location', '$rootScope', '$translate', @@ -11,6 +12,7 @@ module.exports = [ 'PostFilters', function ( $q, + $filter, $location, $rootScope, $translate, @@ -44,7 +46,9 @@ function ( $scope.views = ViewHelper.views(); $scope.cpySavedSearch = _.clone($scope.savedSearch); - + // translate the description and name if they have a translation available (ie the "My posts" search) + $scope.cpySavedSearch.description = $filter('translate')($scope.cpySavedSearch.description); + $scope.cpySavedSearch.name = $filter('translate')($scope.cpySavedSearch.name); $scope.save = function (savedSearch) { $scope.isSaving = true; var persist = savedSearch.id ? SavedSearchEndpoint.update : SavedSearchEndpoint.save; diff --git a/app/main/posts/savedsearches/savedsearch-editor.html b/app/main/posts/savedsearches/savedsearch-editor.html index 06048af4ef..db96aaab51 100644 --- a/app/main/posts/savedsearches/savedsearch-editor.html +++ b/app/main/posts/savedsearches/savedsearch-editor.html @@ -2,12 +2,12 @@
- +
-