From cfcf73b6a18b14481c9dbb4e4149b8d02200cefc Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 4 Jun 2019 20:39:32 +0100 Subject: [PATCH] Make save and saving messages translatable in subscriptions items panel --- .../controllers/products_panel_controller.js.coffee | 6 +++--- app/views/admin/subscriptions/_products_panel.html.haml | 6 +++--- config/locales/en.yml | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/admin/subscriptions/controllers/products_panel_controller.js.coffee b/app/assets/javascripts/admin/subscriptions/controllers/products_panel_controller.js.coffee index f9adbf8584..928654ace3 100644 --- a/app/assets/javascripts/admin/subscriptions/controllers/products_panel_controller.js.coffee +++ b/app/assets/javascripts/admin/subscriptions/controllers/products_panel_controller.js.coffee @@ -10,14 +10,14 @@ angular.module("admin.subscriptions").controller "ProductsPanelController", ($sc $scope.save = -> $scope.saving = true - StatusMessage.display 'progress', 'Saving...' + StatusMessage.display 'progress', t('js.saving') $scope.subscription.update().then (response) -> $scope.saving = false - StatusMessage.display 'success', 'Saved' + StatusMessage.display 'success', t('js.changes_saved') , (response) -> $scope.saving = false if response.data?.errors? keys = Object.keys(response.data.errors) StatusMessage.display 'failure', response.data.errors[keys[0]][0] else - StatusMessage.display 'success', 'Saved' + StatusMessage.display 'success', t('js.changes_saved') diff --git a/app/views/admin/subscriptions/_products_panel.html.haml b/app/views/admin/subscriptions/_products_panel.html.haml index 99ac81f984..330e2fe0c1 100644 --- a/app/views/admin/subscriptions/_products_panel.html.haml +++ b/app/views/admin/subscriptions/_products_panel.html.haml @@ -5,11 +5,11 @@ = render 'products' %a.button.update.fullwidth{ ng: { class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } %span{ ng: {hide: "saved() || saving" } } - SAVE + = t('.save') %i.icon-save %span{ ng: {show: "saved() && !saving" } } - SAVED + = t('.saved') %i.icon-ok-sign %span{ ng: {show: "saving" } } - SAVING + = t('.saving') %i.icon-refresh diff --git a/config/locales/en.yml b/config/locales/en.yml index 82bb5bca66..9d0d03ce01 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1056,6 +1056,10 @@ en: address: Address products: Products no_open_or_upcoming_order_cycle: "No Upcoming Order Cycle" + products_panel: + save: "SAVE" + saving: "SAVING" + saved: "SAVED" product_already_in_order: This product has already been added to the order. Please edit the quantity directly. orders: number: Number