From d2fa51bc44172edb29ba0edcededbd6646053bd4 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")`. --- 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 5968fab8ad5..6363feef47a 100644 --- a/core/config/locales/en.yml +++ b/core/config/locales/en.yml @@ -1516,6 +1516,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.