From d23d5d40b9d08a731e8503197197c58f90cc467c Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Wed, 4 Dec 2024 20:24:29 +0100 Subject: [PATCH] Set `default_locale` for custom I18n config Otherwise, the `with_locale` block will try to set back any locale set by the host app, which might or might not be :en, leading to an `I18n::InvalidLocale` error. Addresses #219. --- lib/mission_control/jobs/i18n_config.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mission_control/jobs/i18n_config.rb b/lib/mission_control/jobs/i18n_config.rb index 442d61f6..c0cf378e 100644 --- a/lib/mission_control/jobs/i18n_config.rb +++ b/lib/mission_control/jobs/i18n_config.rb @@ -2,4 +2,8 @@ class MissionControl::Jobs::I18nConfig < ::I18n::Config def available_locales [ :en ] end + + def default_locale + :en + end end