Handle plural (and 0) on orders selection component

This commit is contained in:
Jean-Baptiste Bellet
2022-07-06 09:48:12 +02:00
parent 75b71738df
commit 06b1c9aa40
2 changed files with 10 additions and 3 deletions

View File

@@ -24,8 +24,12 @@
- if Spree::Config[:enable_invoices?]
.ofn-drop-down-with-prepend
.ofn-drop-down-prepend{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
{{ selected_orders.length }}
=t('.selected')
%span{"ng-show" => "selected_orders.length == 0"}
= t('.selected.zero')
%span{"ng-show" => "selected_orders.length == 1"}
= t('.selected.one')
%span{"ng-show" => "selected_orders.length > 1"}
= t('.selected.many', count: "{{ selected_orders.length }}")
.ofn-drop-down{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
%span{ :class => 'icon-reorder' }
="#{t('admin.actions')}".html_safe

View File

@@ -3774,7 +3774,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using
results_found: "%{number} Results found."
viewing: "Viewing %{start} to %{end}."
print_invoices: "Print Invoices"
selected: selected
selected:
zero: "No order selected"
one: "1 order selected"
many: "%{count} orders selected"
sortable_header:
payment_state: "Payment State"
shipment_state: "Shipment State"