From 3bce2eb7b5fb734d2faeabb21d8f088cc4cfcb5f Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 9 Nov 2016 11:34:55 +1100 Subject: [PATCH] Rename translation key `checkout` to avoid conflicts A top-level translation key `checkout` can't co-exist with translation keys in the path `checkout`. Moving the old key to `shared.menu.cart.checkout` avoids conflicts. It also structures the locale better by view. --- app/views/shared/menu/_cart.html.haml | 4 ++-- config/locales/en.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml index b678c17152..0cbe12b917 100644 --- a/app/views/shared/menu/_cart.html.haml +++ b/app/views/shared/menu/_cart.html.haml @@ -15,7 +15,7 @@ %a.button.secondary.tiny.add_to_cart{ href: cart_path, type: :submit, "ng-disabled" => "Cart.dirty || Cart.empty()", "ng-class" => "{ dirty: Cart.dirty }" } = "{{ Cart.dirty ? '#{t(:cart_updating)}' : (Cart.empty() ? '#{t(:cart_empty)}' : '#{t(:cart_edit)}' ) }}" %a.button.primary.tiny{href: checkout_path, "ng-disabled" => "Cart.dirty || Cart.empty()"} - = t 'checkout' + = t '.checkout' %table %tr.product-cart{"ng-repeat" => "line_item in Cart.line_items", "id" => "cart-variant-{{ line_item.variant.id }}"} %td @@ -47,7 +47,7 @@ %a.button.secondary.tiny.add_to_cart{ href: cart_path, type: :submit, "ng-disabled" => "Cart.dirty || Cart.empty()", "ng-class" => "{ dirty: Cart.dirty }" } = "{{ Cart.dirty ? '#{t(:cart_updating)}' : (Cart.empty() ? '#{t(:cart_empty)}' : '#{t(:cart_edit)}' ) }}" %a.button.primary.tiny{href: checkout_path, "ng-disabled" => "Cart.dirty || Cart.empty()"} - = t 'checkout' + = t '.checkout' - if show_bought_items? %h5{"ng-if" => "Cart.line_items_finalised.length", style: 'margin-top: 1em'} = t '.already_ordered_products' diff --git a/config/locales/en.yml b/config/locales/en.yml index 03832b9959..3a421a192d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -558,6 +558,7 @@ en: shared: menu: cart: + checkout: "Checkout now" already_ordered_products: "Already ordered in this order cycle" register_call: selling_on_ofn: "Interested in getting on the Open Food Network?" @@ -656,7 +657,6 @@ en: items: "items" cart_headline: "Your shopping cart" total: "Total" - checkout: "Checkout now" cart_updating: "Updating cart..." cart_empty: "Cart empty" cart_edit: "Edit your cart"