From 003e65fbeda8566b4721dd29f246d0397ce1364d Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Sat, 8 Sep 2018 00:33:49 +0800 Subject: [PATCH] Translate error when failing to create order cycle --- .../admin/order_cycles/services/order_cycle.js.coffee | 4 ++-- config/locales/en.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/order_cycles/services/order_cycle.js.coffee b/app/assets/javascripts/admin/order_cycles/services/order_cycle.js.coffee index 59d9b4f994a..cac1c9ca87f 100644 --- a/app/assets/javascripts/admin/order_cycles/services/order_cycle.js.coffee +++ b/app/assets/javascripts/admin/order_cycles/services/order_cycle.js.coffee @@ -156,7 +156,7 @@ angular.module('admin.orderCycles').factory 'OrderCycle', ($resource, $window, S if response.data.errors? StatusMessage.display('failure', response.data.errors[0]) else - StatusMessage.display('failure', 'Failed to create order cycle') + StatusMessage.display('failure', t('js.order_cycles.create_failure')) update: (destination, form) -> return unless @confirmNoDistributors() @@ -171,7 +171,7 @@ angular.module('admin.orderCycles').factory 'OrderCycle', ($resource, $window, S if response.data.errors? StatusMessage.display('failure', response.data.errors[0]) else - StatusMessage.display('failure', 'Failed to create order cycle') + StatusMessage.display('failure', t('js.order_cycles.update_failure')) confirmNoDistributors: -> diff --git a/config/locales/en.yml b/config/locales/en.yml index f34706ca29b..5b54f0530ac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2565,7 +2565,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using This will set stock level to zero on all products for this enterprise that are not present in the uploaded file. order_cycles: + create_failure: "Failed to create order cycle" update_success: 'Your order cycle has been updated.' + update_failure: "Failed to update order cycle" no_distributors: There are no distributors in this order cycle. This order cycle will not be visible to customers until you add one. Would you like to continue saving this order cycle?' enterprises: producer: "Producer"