From 68ece47febdeb5a283d065301bd61e90de2c6455 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 3077f7b364d..447f95c3908 100644 --- a/core/config/locales/en.yml +++ b/core/config/locales/en.yml @@ -1549,6 +1549,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.