From 7c39c45f7960bcc43244ed32784b5cc7d6778ddf Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 26 Feb 2019 17:03:26 +0000 Subject: [PATCH] Stop using inexistent en.order_state translations keys and use existing en.spree.order_state in haml code and new js.admin.orders.order_state in JS code --- .../controllers/orders_panel_controller.js.coffee | 2 +- app/views/spree/admin/orders/_filters.html.haml | 2 +- app/views/spree/admin/orders/_sortable_header.html.haml | 2 +- app/views/spree/admin/orders/index.html.haml | 6 +++--- app/views/spree/admin/shared/_order_tabs.html.haml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/admin/subscriptions/controllers/orders_panel_controller.js.coffee b/app/assets/javascripts/admin/subscriptions/controllers/orders_panel_controller.js.coffee index 1c22669903..98dbd14505 100644 --- a/app/assets/javascripts/admin/subscriptions/controllers/orders_panel_controller.js.coffee +++ b/app/assets/javascripts/admin/subscriptions/controllers/orders_panel_controller.js.coffee @@ -19,4 +19,4 @@ angular.module("admin.subscriptions").controller "OrdersPanelController", ($scop text = if closes_at > moment() then t('js.subscriptions.closes') else t('js.subscriptions.closed') "#{text} #{closes_at.fromNow()}" - $scope.stateText = (state) -> t("spree.order_state.#{state}") + $scope.stateText = (state) -> t("js.admin.orders.order_state.#{state}") diff --git a/app/views/spree/admin/orders/_filters.html.haml b/app/views/spree/admin/orders/_filters.html.haml index 1cefe0e1eb..ef0348a6f0 100644 --- a/app/views/spree/admin/orders/_filters.html.haml +++ b/app/views/spree/admin/orders/_filters.html.haml @@ -11,7 +11,7 @@ .field = label_tag nil, t(:status) = select_tag("q[state_eq]", - options_for_select(Spree::Order.state_machines[:state].states.collect {|s| [t("order_state.#{s.name}"), s.value]}), + options_for_select(Spree::Order.state_machines[:state].states.collect {|s| [t("spree.order_state.#{s.name}"), s.value]}), {include_blank: true, class: 'select2', 'ng-model' => 'q.state_eq'}) .four.columns .field diff --git a/app/views/spree/admin/orders/_sortable_header.html.haml b/app/views/spree/admin/orders/_sortable_header.html.haml index 97d24165c0..3aa8908576 100644 --- a/app/views/spree/admin/orders/_sortable_header.html.haml +++ b/app/views/spree/admin/orders/_sortable_header.html.haml @@ -1,4 +1,4 @@ %a{'ng-click' => "sortOptions.toggle('#{column_name}')"} - = t(column_name.to_s, scope: 'activerecord.attributes.spree/order') + = t(".#{column_name.to_s}") %span{'ng-show' => "sorting == '#{column_name} asc'"}= "▲".html_safe %span{'ng-show' => "sorting == '#{column_name} desc'"}= "▼".html_safe \ No newline at end of file diff --git a/app/views/spree/admin/orders/index.html.haml b/app/views/spree/admin/orders/index.html.haml index 1f3a96de34..fcf1b7cbc5 100644 --- a/app/views/spree/admin/orders/index.html.haml +++ b/app/views/spree/admin/orders/index.html.haml @@ -59,14 +59,14 @@ = t('.note') %td.align-center %span.state{'ng-class' => 'order.state'} - {{'order_state.' + order.state | t}} + {{'js.admin.orders.order_state.' + order.state | t}} %td.align-center %span.state{'ng-class' => 'order.payment_state', 'ng-if' => 'order.payment_state'} %a{'ng-href' => '{{order.payments_path}}' } - {{'payment_states.' + order.payment_state | t}} + {{'js.admin.orders.payment_states.' + order.payment_state | t}} %td.align-center %span.state{'ng-class' => 'order.shipment_state', 'ng-if' => 'order.shipment_state'} - {{'shipment_states.' + order.shipment_state | t}} + {{'js.admin.orders.shipment_states.' + order.shipment_state | t}} %td = mail_to "{{order.email}}" %td.align-center diff --git a/app/views/spree/admin/shared/_order_tabs.html.haml b/app/views/spree/admin/shared/_order_tabs.html.haml index b4b1333a3a..fa5fbf5036 100644 --- a/app/views/spree/admin/shared/_order_tabs.html.haml +++ b/app/views/spree/admin/shared/_order_tabs.html.haml @@ -19,7 +19,7 @@ %dd - order_state_classes = "state #{@order.state}" %span{ class: order_state_classes } - = t(@order.state, scope: :order_state) + = t(@order.state, scope: "spree.order_state") %dt = t(:total) \: