Use plural or singular description in cart, depending on number of items

This commit is contained in:
Matt-Yorkley
2020-06-09 15:36:06 +02:00
parent 850e1b0364
commit 7093e0f7a3
2 changed files with 6 additions and 3 deletions

View File

@@ -2,8 +2,10 @@
.background{ng: {click: 'toggleCartSidebar()'}}
.sidebar
.cart-header
%span.title{"ng-show" => "Cart.line_items.length > 0"}
= t('.items_in_cart', num: "{{ Cart.total_item_count() }}")
%span.title{"ng-show" => "Cart.line_items.length == 1"}
= t('.items_in_cart_singular', num: "{{ Cart.total_item_count() }}")
%span.title{"ng-show" => "Cart.line_items.length > 1"}
= t('.items_in_cart_plural', num: "{{ Cart.total_item_count() }}")
%a.close{ng: {click: 'toggleCartSidebar()'}}
= t('.close')
%i.ofn-i_009-close

View File

@@ -1219,7 +1219,8 @@ en:
cart_sidebar:
checkout: "Checkout"
edit_cart: "Edit cart"
items_in_cart: "%{num} items in your cart"
items_in_cart_singular: "%{num} item in your cart"
items_in_cart_plural: "%{num} items in your cart"
close: "Close"
cart_empty: "Your cart is empty"
take_me_shopping: "Take me shopping!"