From 8543bb7cfb101afbc8cde0c963ae1e150ffecdb8 Mon Sep 17 00:00:00 2001 From: Isaac Haseley Date: Wed, 23 Jan 2019 12:23:35 -0600 Subject: [PATCH 1/4] Add missing 'active products' translation on dashboard --- app/views/spree/admin/overview/_products.html.haml | 2 +- config/locales/en.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 37de2f11d4..459aa3483c 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -12,7 +12,7 @@ - if @product_count > 0 %div.seven.columns.alpha.list-item %span.six.columns.alpha - = "You have #{@product_count} active product#{@product_count > 1 ? "s" : ""}." + = t(".you_have") + " #{@product_count} #{@product_count > 1 ? t(".active_products") : t(".active_product")}." %span.one.column.omega %span.icon-ok-sign %a.seven.columns.alpha.button.bottom.blue{ href: "#{admin_products_path}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 0bde4fb005..7557acbb84 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2716,6 +2716,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using distributor: "Distributor:" order_cycle: "Order cycle:" overview: + products: + you_have: "You have" + active_products: "active products" + active_product: "active product" order_cycles: order_cycles: "Order Cycles" order_cycles_tip: "Order cycles determine when and where your products are available to customers." From a18c98191a8503a8f6c74c26593002ea76dd92fc Mon Sep 17 00:00:00 2001 From: Isaac Haseley Date: Fri, 25 Jan 2019 14:51:19 -0600 Subject: [PATCH 2/4] Better accomodate different sentence structures --- app/views/spree/admin/overview/_products.html.haml | 5 ++++- config/locales/en.yml | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 459aa3483c..010bcfcf77 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -12,7 +12,10 @@ - if @product_count > 0 %div.seven.columns.alpha.list-item %span.six.columns.alpha - = t(".you_have") + " #{@product_count} #{@product_count > 1 ? t(".active_products") : t(".active_product")}." + - if @product_count == 1 + = t(".active_products_count_single", product_count: @product_count ) + - else + = t(".active_products_count_multiple", product_count: @product_count ) %span.one.column.omega %span.icon-ok-sign %a.seven.columns.alpha.button.bottom.blue{ href: "#{admin_products_path}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 7557acbb84..7c14048cdd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2717,9 +2717,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using order_cycle: "Order cycle:" overview: products: - you_have: "You have" - active_products: "active products" - active_product: "active product" + active_products_count_single: "You have %{product_count} active product" + active_products_count_multiple: "You have %{product_count} active products" order_cycles: order_cycles: "Order Cycles" order_cycles_tip: "Order cycles determine when and where your products are available to customers." From 73a58435a8f76c06ad58092165fc57e803ed3ff6 Mon Sep 17 00:00:00 2001 From: Isaac Haseley Date: Thu, 31 Jan 2019 21:45:12 -0600 Subject: [PATCH 3/4] Adopt one/other pluralization --- app/views/spree/admin/overview/_products.html.haml | 5 +---- config/locales/en.yml | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index 010bcfcf77..effc671162 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -12,10 +12,7 @@ - if @product_count > 0 %div.seven.columns.alpha.list-item %span.six.columns.alpha - - if @product_count == 1 - = t(".active_products_count_single", product_count: @product_count ) - - else - = t(".active_products_count_multiple", product_count: @product_count ) + = t(".active_products", count: @product_count ) %span.one.column.omega %span.icon-ok-sign %a.seven.columns.alpha.button.bottom.blue{ href: "#{admin_products_path}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 7c14048cdd..59b519de8f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2717,8 +2717,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using order_cycle: "Order cycle:" overview: products: - active_products_count_single: "You have %{product_count} active product" - active_products_count_multiple: "You have %{product_count} active products" + active_products: + one: "You have one active product" + other: "You have %{count} active products" order_cycles: order_cycles: "Order Cycles" order_cycles_tip: "Order cycles determine when and where your products are available to customers." From 09d3cea83097e5d9102b12cb1054fa72fdf9da4f Mon Sep 17 00:00:00 2001 From: Isaac Haseley Date: Fri, 1 Feb 2019 09:22:26 -0600 Subject: [PATCH 4/4] Lazy-load one more translation --- app/views/spree/admin/overview/_products.html.haml | 2 +- config/locales/en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/spree/admin/overview/_products.html.haml b/app/views/spree/admin/overview/_products.html.haml index effc671162..539eecd943 100644 --- a/app/views/spree/admin/overview/_products.html.haml +++ b/app/views/spree/admin/overview/_products.html.haml @@ -21,7 +21,7 @@ - else %div.seven.columns.alpha.list-item.red %span.six.columns.alpha - = t "spree_admin_enterprises_any_active_products_text" + = t(".active_products", count: @product_count ) %span.one.column.omega %span.icon-remove-sign %a.seven.columns.alpha.button.bottom.red{ href: "#{new_admin_product_path}" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 59b519de8f..4c76f68854 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2149,7 +2149,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using spree_admin_enterprises_none_text: "You don't have any enterprises yet" spree_admin_enterprises_tabs_hubs: "HUBS" spree_admin_enterprises_producers_manage_products: "MANAGE PRODUCTS" - spree_admin_enterprises_any_active_products_text: "You don't have any active products." spree_admin_enterprises_create_new_product: "CREATE A NEW PRODUCT" spree_admin_single_enterprise_alert_mail_confirmation: "Please confirm the email address for" spree_admin_single_enterprise_alert_mail_sent: "We've sent an email to" @@ -2718,6 +2717,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using overview: products: active_products: + zero: "You don't have any active products." one: "You have one active product" other: "You have %{count} active products" order_cycles: