From 09f86398efea6e688a015398f50bfc8b33997058 Mon Sep 17 00:00:00 2001 From: Sang Huynh Thanh Date: Fri, 12 Apr 2024 16:17:07 +0700 Subject: [PATCH] Add default value for AVAILABLE_LOCALES --- .template/spec/base/config/environments/production_spec.rb | 6 +++--- config/environments/production.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.template/spec/base/config/environments/production_spec.rb b/.template/spec/base/config/environments/production_spec.rb index 4c1f7776..87b65a1c 100644 --- a/.template/spec/base/config/environments/production_spec.rb +++ b/.template/spec/base/config/environments/production_spec.rb @@ -33,13 +33,13 @@ def mailer_default_url_config def i18n_config <<~RUBY # eg: AVAILABLE_LOCALES = 'en,th' - config.i18n.available_locales = ENV.fetch('AVAILABLE_LOCALES').split(',') + config.i18n.available_locales = ENV.fetch('AVAILABLE_LOCALES', 'en').split(',') # eg: DEFAULT_LOCALE = 'en' - config.i18n.default_locale = ENV.fetch('DEFAULT_LOCALE') + config.i18n.default_locale = ENV.fetch('DEFAULT_LOCALE', 'en') # eg: FALLBACK_LOCALES = 'en,th' - config.i18n.fallbacks = ENV.fetch('FALLBACK_LOCALES').split(',') + config.i18n.fallbacks = ENV.fetch('FALLBACK_LOCALES', 'en').split(',') RUBY end end diff --git a/config/environments/production.rb b/config/environments/production.rb index fb8e5e3e..5f1a7e83 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -23,13 +23,13 @@ environment do <<~RUBY # eg: AVAILABLE_LOCALES = 'en,th' - config.i18n.available_locales = ENV.fetch('AVAILABLE_LOCALES').split(',') + config.i18n.available_locales = ENV.fetch('AVAILABLE_LOCALES', 'en').split(',') # eg: DEFAULT_LOCALE = 'en' - config.i18n.default_locale = ENV.fetch('DEFAULT_LOCALE') + config.i18n.default_locale = ENV.fetch('DEFAULT_LOCALE', 'en') # eg: FALLBACK_LOCALES = 'en,th' - config.i18n.fallbacks = ENV.fetch('FALLBACK_LOCALES').split(',') + config.i18n.fallbacks = ENV.fetch('FALLBACK_LOCALES', 'en').split(',') RUBY end