From 6a6a1298dfd2f0498c7dc5b09c49d9b8ae9204d6 Mon Sep 17 00:00:00 2001 From: Greg Austic Date: Wed, 25 Mar 2026 20:18:30 -0400 Subject: [PATCH 1/3] Fix raw JSON blob showing on Subscriptions screen (#14099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `orders.customer_credit_service` locale keys added by PR #13963 were placed under an `orders:` namespace in locale files. In en.yml this created a duplicate `orders:` key, causing YAML to override the existing `orders: "Orders"` string with the hash — so `t('orders')` returned the hash instead of "Orders", showing raw JSON on the screen. Move translations to `customer_credit_service:` at the top level and update the service's `translation_scope` to match. Fixes #14099 Co-Authored-By: Claude Sonnet 4.6 --- app/services/orders/customer_credit_service.rb | 2 +- config/locales/en.yml | 9 ++++----- config/locales/en_GB.yml | 9 ++++----- config/locales/fr.yml | 9 ++++----- config/locales/fr_BE.yml | 9 ++++----- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/app/services/orders/customer_credit_service.rb b/app/services/orders/customer_credit_service.rb index 59823d84fe..10a913eeb8 100644 --- a/app/services/orders/customer_credit_service.rb +++ b/app/services/orders/customer_credit_service.rb @@ -92,7 +92,7 @@ module Orders end def translation_scope - "orders.customer_credit_service" + "customer_credit_service" end class Response diff --git a/config/locales/en.yml b/config/locales/en.yml index 2b8134bc77..2d518b258b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5220,8 +5220,7 @@ en: credit_payment_method_missing: Credit payment method is missing no_credit_available: No credit available not_enough_credit_available: Not enough credit available - orders: - customer_credit_service: - no_credit_owed: No credit owed - credit_payment_method_missing: Customer credit payment method is missing, please check configuration - refund_sucessful: Refund successful! + customer_credit_service: + no_credit_owed: No credit owed + credit_payment_method_missing: Customer credit payment method is missing, please check configuration + refund_sucessful: Refund successful! diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 0e1319729c..4e11c906db 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -5037,8 +5037,7 @@ en_GB: credit_payment_method_missing: Credit payment method is missing no_credit_available: No credit available not_enough_credit_available: Not enough credit available - orders: - customer_credit_service: - no_credit_owed: No credit owed - credit_payment_method_missing: Customer credit payment method is missing, please check configuration - refund_sucessful: Refund successful! + customer_credit_service: + no_credit_owed: No credit owed + credit_payment_method_missing: Customer credit payment method is missing, please check configuration + refund_sucessful: Refund successful! diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7803dc0434..b957d78635 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5116,8 +5116,7 @@ fr: credit_payment_method_missing: Le mode de paiement par crédit est manquant. no_credit_available: Aucun crédit disponible not_enough_credit_available: Crédit disponible insuffisant - orders: - customer_credit_service: - no_credit_owed: Aucun crédit dû - credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. - refund_sucessful: Remboursement effectué avec succès ! + customer_credit_service: + no_credit_owed: Aucun crédit dû + credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. + refund_sucessful: Remboursement effectué avec succès ! diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index df4d694c75..3d96b3bc52 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -5070,8 +5070,7 @@ fr_BE: credit_payment_method_missing: Le mode de paiement par crédit est manquant. no_credit_available: Pas de crédit disponible not_enough_credit_available: Pas assez de crédit disponible - orders: - customer_credit_service: - no_credit_owed: Aucun crédit dû - credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. - refund_sucessful: Remboursement effectué avec succès ! + customer_credit_service: + no_credit_owed: Aucun crédit dû + credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. + refund_sucessful: Remboursement effectué avec succès ! From 3daabe70ed3bed52925ff569813df56af1d80803 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 27 Mar 2026 10:28:17 +1100 Subject: [PATCH 2/3] Undo changes to locales which will come from Transifex --- config/locales/en_GB.yml | 9 +++++---- config/locales/fr.yml | 9 +++++---- config/locales/fr_BE.yml | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 4e11c906db..0e1319729c 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -5037,7 +5037,8 @@ en_GB: credit_payment_method_missing: Credit payment method is missing no_credit_available: No credit available not_enough_credit_available: Not enough credit available - customer_credit_service: - no_credit_owed: No credit owed - credit_payment_method_missing: Customer credit payment method is missing, please check configuration - refund_sucessful: Refund successful! + orders: + customer_credit_service: + no_credit_owed: No credit owed + credit_payment_method_missing: Customer credit payment method is missing, please check configuration + refund_sucessful: Refund successful! diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b957d78635..7803dc0434 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5116,7 +5116,8 @@ fr: credit_payment_method_missing: Le mode de paiement par crédit est manquant. no_credit_available: Aucun crédit disponible not_enough_credit_available: Crédit disponible insuffisant - customer_credit_service: - no_credit_owed: Aucun crédit dû - credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. - refund_sucessful: Remboursement effectué avec succès ! + orders: + customer_credit_service: + no_credit_owed: Aucun crédit dû + credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. + refund_sucessful: Remboursement effectué avec succès ! diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index 3d96b3bc52..df4d694c75 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -5070,7 +5070,8 @@ fr_BE: credit_payment_method_missing: Le mode de paiement par crédit est manquant. no_credit_available: Pas de crédit disponible not_enough_credit_available: Pas assez de crédit disponible - customer_credit_service: - no_credit_owed: Aucun crédit dû - credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. - refund_sucessful: Remboursement effectué avec succès ! + orders: + customer_credit_service: + no_credit_owed: Aucun crédit dû + credit_payment_method_missing: Le mode de paiement par crédit client est manquant. Veuillez vérifier la configuration. + refund_sucessful: Remboursement effectué avec succès ! From 78ee53f728df5fa48e17fcc5092cd3f4b09a14ca Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 27 Mar 2026 13:06:16 +1100 Subject: [PATCH 3/3] Fix config leak in specs --- spec/system/admin/variants_spec.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/system/admin/variants_spec.rb b/spec/system/admin/variants_spec.rb index 2f6280f778..c4653b48ff 100644 --- a/spec/system/admin/variants_spec.rb +++ b/spec/system/admin/variants_spec.rb @@ -220,13 +220,9 @@ RSpec.describe ' let(:product) { create(:simple_product) } let(:variant) { product.variants.first } - around do |example| - I18n.default_locale = :es - example.run - I18n.default_locale = :en - end - before do + allow(I18n).to receive(:default_locale).and_return(:es) + variant.update( unit_value: 1, unit_description: 'foo' ) # When I view the variant