diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index 5987b20475..6b42d3bca5 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -48,7 +48,7 @@ module EnterprisesHelper def enterprise_type_name(enterprise) if enterprise.sells == 'none' - enterprise.producer_profile_only ? 'Profile' : 'Supplier Only' + enterprise.producer_profile_only ? I18n.t(:profile) : I18n.t(:supplier_only) else "Has Shopfront" end @@ -56,7 +56,7 @@ module EnterprisesHelper def enterprise_confirm_delete_message(enterprise) if enterprise.supplied_products.present? - "This will also delete the #{pluralize enterprise.supplied_products.count, 'product'} that this enterprise supplies. Are you sure you want to continue?" + I18n.t(:enterprise_confirm_delete_message, product: pluralize(enterprise.supplied_products.count, 'product')) else t(:are_you_sure) end diff --git a/app/helpers/order_cycles_helper.rb b/app/helpers/order_cycles_helper.rb index 3edff28e1e..e8271cd68f 100644 --- a/app/helpers/order_cycles_helper.rb +++ b/app/helpers/order_cycles_helper.rb @@ -85,14 +85,14 @@ module OrderCyclesHelper disabled_message = nil if options[:shipping_and_payment_methods] && (e.shipping_methods.empty? || e.payment_methods.available.empty?) if e.shipping_methods.empty? && e.payment_methods.available.empty? - disabled_message = 'no shipping or payment methods' + disabled_message = I18n.t(:no_shipping_or_payment) elsif e.shipping_methods.empty? - disabled_message = 'no shipping methods' + disabled_message = I18n.t(:no_shipping) elsif e.payment_methods.available.empty? - disabled_message = 'no payment methods' + disabled_message = I18n.t(:no_payment) end elsif options[:confirmed] && !e.confirmed? - disabled_message = 'unconfirmed' + disabled_message = I18n.t(:unconfirmed) end if disabled_message diff --git a/app/helpers/spree/products_helper_decorator.rb b/app/helpers/spree/products_helper_decorator.rb index d755db00b7..20e6eeb803 100644 --- a/app/helpers/spree/products_helper_decorator.rb +++ b/app/helpers/spree/products_helper_decorator.rb @@ -15,9 +15,9 @@ module Spree end def product_variant_unit_options - [['Weight', 'weight'], - ['Volume', 'volume'], - ['Items', 'items']] + [[I18n.t(:weight), 'weight'], + [I18n.t(:volume), 'volume'], + [I18n.t(:items), 'items']] end end end diff --git a/app/helpers/spree/reports_helper.rb b/app/helpers/spree/reports_helper.rb index aaed402a6f..0875794f95 100644 --- a/app/helpers/spree/reports_helper.rb +++ b/app/helpers/spree/reports_helper.rb @@ -25,8 +25,8 @@ module Spree end def xero_report_types - [['Summary', 'summary'], - ['Detailed', 'detailed']] + [[I18n.t(:summary), 'summary'], + [I18n.t(:detailed), 'detailed']] end def currency_symbol diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index 102ac60417..a66c2cada1 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -10,7 +10,7 @@ class ProducerMailer < Spree::BaseMailer @total = total_from_line_items(line_items) @tax_total = tax_total_from_line_items(line_items) - subject = "[#{Spree::Config.site_name}] Order cycle report for #{producer.name}" + subject = "[#{Spree::Config.site_name}] #{I18n.t('producer_mailer.order_cycle.subject', producer: producer.name)}" if has_orders? order_cycle, producer mail(to: @producer.email, diff --git a/config/locales/en.yml b/config/locales/en.yml index def4fa7c3e..2f1a822b9d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -82,6 +82,9 @@ en: subject: "Please confirm the email address for %{enterprise}" welcome: subject: "%{enterprise} is now on %{sitename}" + producer_mailer: + order_cycle: + subject: "Order cycle report for %{producer}" home: "OFN" title: Open Food Network welcome_to: 'Welcome to ' @@ -143,6 +146,14 @@ en: dashboard: Dashboard undefined: undefined unused: unused + admin_and_handling: Admin & Handling + profile: Profile + supplier_only: Supplier Only + weight: Weight + volume: Volume + items: Items + summary: Summary + detailed: Detailed 'yes': "Yes" 'no': "No" 'y': 'Y' @@ -643,10 +654,6 @@ en: enterprise_issues: create_new: Create New resend_email: Resend Email - no_shipping: no shipping methods - no_payment: no payment methods - no_shipping_or_payment: no shipping or payment methods - unconfirmed: unconfirmed has_no_payment_methods: "%{enterprise} currently has no payment methods" has_no_shipping_methods: "%{enterprise} currently has no shipping methods" email_confirmation: "Email confirmation is pending. We've sent a confirmation email to #{email}." @@ -798,7 +805,14 @@ en: terms_of_service: "Terms of service" on_demand: On demand none: None +<<<<<<< HEAD not_allowed: Not allowed +======= + no_shipping: no shipping methods + no_payment: no payment methods + no_shipping_or_payment: no shipping or payment methods + unconfirmed: unconfirmed +>>>>>>> Extract translations from mailers and helpers label_shops: "Shops" label_map: "Map" @@ -1251,6 +1265,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using failed_to_create_enterprise: "Failed to create your enterprise." failed_to_create_enterprise_unknown: "Failed to create your enterprise.\nPlease ensure all fields are completely filled out." failed_to_update_enterprise_unknown: "Failed to update your enterprise.\nPlease ensure all fields are completely filled out." + enterprise_confirm_delete_message: "This will also delete the %{product} that this enterprise supplies. Are you sure you want to continue?" order_not_saved_yet: "Your order hasn't been saved yet. Give us a few seconds to finish!" filter_by: "Filter by" hide_filters: "Hide filters" diff --git a/lib/open_food_network/enterprise_issue_validator.rb b/lib/open_food_network/enterprise_issue_validator.rb index f07e70438e..6cbb2a70c1 100644 --- a/lib/open_food_network/enterprise_issue_validator.rb +++ b/lib/open_food_network/enterprise_issue_validator.rb @@ -30,13 +30,13 @@ module OpenFoodNetwork def issues_summary(opts={}) if !opts[:confirmation_only] && !shipping_methods_ok? && !payment_methods_ok? - I18n.t('admin.enterprise_issues.no_shipping_or_payment') + I18n.t(:no_shipping_or_payment) elsif !opts[:confirmation_only] && !shipping_methods_ok? - I18n.t('admin.enterprise_issues.no_shipping') + I18n.t(:no_shipping) elsif !opts[:confirmation_only] && !payment_methods_ok? - I18n.t('admin.enterprise_issues.no_payment') + I18n.t(:no_payment) elsif !confirmed? - I18n.t('admin.enterprise_issues.unconfirmed') + I18n.t(:unconfirmed) end end