From 165af4b812b1d7c8abffa15b42a8d2ff48cad593 Mon Sep 17 00:00:00 2001 From: Pierre de Lacroix Date: Tue, 26 Sep 2017 16:04:48 +0200 Subject: [PATCH] Use I18n "lazy" lookup --- .../bulk_edit/_products_head.html.haml | 14 +++++++------- config/locales/en.yml | 18 +++++++++--------- .../column_preference_defaults.rb | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/spree/admin/products/bulk_edit/_products_head.html.haml b/app/views/spree/admin/products/bulk_edit/_products_head.html.haml index 96e3575a74..6ebe7b1f24 100644 --- a/app/views/spree/admin/products/bulk_edit/_products_head.html.haml +++ b/app/views/spree/admin/products/bulk_edit/_products_head.html.haml @@ -23,16 +23,16 @@ = t(:expand_all) %th.producer{ 'ng-show' => 'columns.producer.visible' }=t('admin.producer') %th.sku{ 'ng-show' => 'columns.sku.visible' }=t('admin.sku') - %th.name{ 'ng-show' => 'columns.name.visible' }=t('admin.products.bulk_edit.name') - %th.unit{ 'ng-show' => 'columns.unit.visible' }=t('admin.products.bulk_edit.unit') - %th.display_as{ 'ng-show' => 'columns.unit.visible' }=t('admin.products.bulk_edit.display_as') + %th.name{ 'ng-show' => 'columns.name.visible' }=t('.name') + %th.unit{ 'ng-show' => 'columns.unit.visible' }=t('.unit') + %th.display_as{ 'ng-show' => 'columns.unit.visible' }=t('.display_as') %th.price{ 'ng-show' => 'columns.price.visible' }=t('admin.price') %th.on_hand{ 'ng-show' => 'columns.on_hand.visible' }=t('admin.on_hand') %th.on_demand{ 'ng-show' => 'columns.on_demand.visible' }=t('admin.on_demand?') - %th.category{ 'ng-show' => 'columns.category.visible' }=t('admin.products.bulk_edit.category') - %th.tax_category{ 'ng-show' => 'columns.tax_category.visible' }=t('admin.products.bulk_edit.tax_category') - %th.inherits_properties{ 'ng-show' => 'columns.inherits_properties.visible' }=t('admin.products.bulk_edit.inherits_proerties?') - %th.available_on{ 'ng-show' => 'columns.available_on.visible' }=t('admin.products.bulk_edit.av_on') + %th.category{ 'ng-show' => 'columns.category.visible' }=t('.category') + %th.tax_category{ 'ng-show' => 'columns.tax_category.visible' }=t('.tax_category') + %th.inherits_properties{ 'ng-show' => 'columns.inherits_properties.visible' }=t('.inherits_properties?') + %th.available_on{ 'ng-show' => 'columns.available_on.visible' }=t('.av_on') %th.actions %th.actions %th.actions diff --git a/config/locales/en.yml b/config/locales/en.yml index 76c1eb9363..b29c873051 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -346,15 +346,6 @@ en: products: unit_name_placeholder: 'eg. bunches' - bulk_edit: - name: Name - unit: Unit - display_as: Display As - category: Category - tax_category: Tax Category - inherits_properties?: Inherits Properties? - available_on: Available On - av_on: "Av. On" properties: property_name: Property Name inherited_property: Inherited Property @@ -2222,6 +2213,15 @@ Please follow the instructions there to make your enterprise visible on the Open title: LOADING PRODUCTS no_products: "No products yet. Why don't you add some?" no_results: "Sorry, no results match" + products_head: + name: Name + unit: Unit + display_as: Display As + category: Category + tax_category: Tax Category + inherits_properties?: Inherits Properties? + available_on: Available On + av_on: "Av. On" product_name: Product Name primary_taxon_form: product_category: Product Category diff --git a/lib/open_food_network/column_preference_defaults.rb b/lib/open_food_network/column_preference_defaults.rb index 6972fa3785..269fb41737 100644 --- a/lib/open_food_network/column_preference_defaults.rb +++ b/lib/open_food_network/column_preference_defaults.rb @@ -56,7 +56,7 @@ module OpenFoodNetwork end def products_bulk_edit_columns - node = "admin.products.bulk_edit" + node = "spree.admin.products.bulk_edit.products_head" { producer: { name: I18n.t("admin.producer"), visible: true }, sku: { name: I18n.t("admin.sku"), visible: false },