From e5346a1ed350de89c01aadf269d116823542c5a0 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Mon, 2 Dec 2024 17:46:25 +0100 Subject: [PATCH] Backend: Add missing error translation We were missing a translation here, but never noticed, because we were not testing for an actual human-understandable string. This is broken in the v4.0, v4.1, v4.2 and v4.3 branches with a noisier error message, because in those branches, `I18n.t("unavailable")` is different from `t("unavailable")`. (cherry picked from commit 506ddfcbd34703c00dbb75b5197646f70099f726) --- backend/spec/controllers/spree/admin/users_controller_spec.rb | 2 +- core/config/locales/en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/spec/controllers/spree/admin/users_controller_spec.rb b/backend/spec/controllers/spree/admin/users_controller_spec.rb index d4e3a3e420e..c8ad0d41f61 100644 --- a/backend/spec/controllers/spree/admin/users_controller_spec.rb +++ b/backend/spec/controllers/spree/admin/users_controller_spec.rb @@ -505,7 +505,7 @@ def user it "cannot be destroyed" do is_expected.to be_forbidden - expect(subject.body).to eq I18n.t("spree.error_user_destroy_with_orders") + expect(subject.body).to eq("Cannot delete a user with orders") end end end diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml index 64de0cbb2b1..2e0fb64cb76 100644 --- a/core/config/locales/en.yml +++ b/core/config/locales/en.yml @@ -1539,6 +1539,7 @@ en: end: End ending_in: Ending in error: error + error_user_destroy_with_orders: Cannot delete a user with orders errors: messages: cannot_delete_finalized_stock_location: Stock Location cannot be destroyed if you have open stock transfers.