From 44ab87961aa1c29fa324f8d00fe24927b94e7808 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 26 Aug 2021 09:08:35 +0200 Subject: [PATCH] i18nize the global error message --- app/controllers/split_checkout_controller.rb | 2 +- config/locales/en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index a26978b3e3..061ef6cf97 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -45,7 +45,7 @@ class SplitCheckoutController < ::BaseController if @shipping_method_id.blank? @order.errors.add(:base, "no_shipping_method_selected") end - flash.now[:error] = "Saving failed, please update the highlighted fields: #{@order.errors.full_messages}" + flash.now[:error] = "#{I18n.t('split_checkout.errors.global')}" render :edit end end diff --git a/config/locales/en.yml b/config/locales/en.yml index bcd1ccab75..6259d37f3b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1692,6 +1692,7 @@ en: submit: Complete order cancel: Back to Payment method errors: + global: "Saving failed, please update the highlighted fields." required: Field cannot be blank invalid_number: "Please enter a valid phone number" invalid_email: "Please enter a valid email address"