| .. | .. |
|---|
| 33 | 33 | '$http', |
|---|
| 34 | 34 | 'toaster', |
|---|
| 35 | 35 | 'Catalogs', |
|---|
| 36 | | - function($scope, $http, toaster, Catalogs) { |
|---|
| 36 | + '$store', |
|---|
| 37 | + '$L', |
|---|
| 38 | + function($scope, $http, toaster, Catalogs, $store, $L) { |
|---|
| 37 | 39 | $scope.showForm = false; |
|---|
| 38 | 40 | $scope.isNew = false; |
|---|
| 39 | 41 | $scope.formu = {}; |
|---|
| .. | .. |
|---|
| 78 | 80 | } |
|---|
| 79 | 81 | |
|---|
| 80 | 82 | $scope.delete = function(data) { |
|---|
| 81 | | - BootstrapDialog.confirm('The record will be deleted, are you sure?', function(result){ |
|---|
| 83 | + BootstrapDialog.confirm($L.get('The record will be deleted, are you sure?'), function(result){ |
|---|
| 82 | 84 | if(result) { |
|---|
| 83 | 85 | var promise = Catalogs.remove(data).$promise; |
|---|
| 84 | 86 | promise.then(function(data) { |
|---|
| 85 | 87 | $scope.list = Catalogs.query(); |
|---|
| 86 | 88 | Catalogs.refreshRef($scope.refs, Catalogs.getMetadata().resource, $scope.list); |
|---|
| 87 | | - toaster.pop('success', Catalogs.getName(), "Element deleted successfully"); |
|---|
| 89 | + toaster.pop('success', Catalogs.getName(), $L.get("Element deleted successfully")); |
|---|
| 88 | 90 | },function(error) { |
|---|
| 89 | 91 | console.log(error); |
|---|
| 90 | | - toaster.pop('error', Catalogs.getName(), "Error deleting element, reason: " + HTTP_ERRORS[error.status] + ". Details: " + error.headers('X-SECURIS-ERROR'), 10000); |
|---|
| 92 | + toaster.pop('error', Catalogs.getName(), $L.get("Error deleting element, reason: {0}. Details: {1}", $L.get(HTTP_ERRORS[error.status]), error.headers('X-SECURIS-ERROR')), 10000); |
|---|
| 91 | 93 | }); |
|---|
| 92 | 94 | } |
|---|
| 93 | 95 | }); |
|---|
| .. | .. |
|---|
| 136 | 138 | |
|---|
| 137 | 139 | $scope.saveCatalog = function() { |
|---|
| 138 | 140 | if ($scope.catalogForm.$invalid) { |
|---|
| 139 | | - toaster.pop('error', Catalogs.getName(), "There are wrong data in current form, please fix it before to save"); |
|---|
| 141 | + toaster.pop('error', Catalogs.getName(), $L.get("There are wrong data in current form, please fix it before to save")); |
|---|
| 140 | 142 | } else { |
|---|
| 141 | 143 | var promise = Catalogs.save($scope.formu).$promise; |
|---|
| 142 | 144 | promise.then(function(data, otro) { |
|---|
| .. | .. |
|---|
| 150 | 152 | $scope.$parent.list = Catalogs.query(); |
|---|
| 151 | 153 | Catalogs.refreshRef($scope.refs, Catalogs.getMetadata().resource, $scope.$parent.list); |
|---|
| 152 | 154 | |
|---|
| 153 | | - toaster.pop('success', Catalogs.getName(), "Element saved successfully"); |
|---|
| 155 | + toaster.pop('success', Catalogs.getName(), $L.get("Element saved successfully")); |
|---|
| 154 | 156 | }, function(error) { |
|---|
| 155 | 157 | console.log(error); |
|---|
| 156 | | - toaster.pop('error', Catalogs.getName(), "Error saving element, reason: " + HTTP_ERRORS[error.status] + ". Details: " + error.headers('X-SECURIS-ERROR'), 10000); |
|---|
| 158 | + toaster.pop('error', Catalogs.getName(), $L.get("Error saving element, reason: {0}. Details: {1}", $L.get(HTTP_ERRORS[error.status]), error.headers('X-SECURIS-ERROR')), 10000); |
|---|
| 157 | 159 | }); |
|---|
| 158 | 160 | |
|---|
| 159 | 161 | } |
|---|