From 0a6479f9591bdde9c8850dc80b5021777a732a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fran=C3=A7a?= Date: Fri, 22 Nov 2019 12:30:25 -0600 Subject: [PATCH] Merge pull request #37756 from plentz/patch-1 Eager load translations during initialization --- Gemfile.lock | 2 +- activesupport/activesupport.gemspec | 2 +- activesupport/lib/active_support/i18n_railtie.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 413c95f05a..70543e21fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,7 +68,7 @@ PATH marcel (~> 0.3.1) activesupport (6.0.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) + i18n (>= 1.6, < 2) minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 41683ef521..e3fbcd972d 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -33,7 +33,7 @@ # NOTE: Please read our dependency guidelines before updating versions: # https://edgeguides.rubyonrails.org/security.html#dependency-management-and-cves - s.add_dependency "i18n", ">= 0.7", "< 2" + s.add_dependency "i18n", ">= 1.6", "< 2" s.add_dependency "tzinfo", "~> 1.1" s.add_dependency "minitest", "~> 5.1" s.add_dependency "concurrent-ruby", "~> 1.0", ">= 1.0.2" diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb index 8faa93a3e4..562c0074cc 100644 --- a/activesupport/lib/active_support/i18n_railtie.rb +++ b/activesupport/lib/active_support/i18n_railtie.rb @@ -12,6 +12,8 @@ class Railtie < Rails::Railtie config.i18n.load_path = [] config.i18n.fallbacks = ActiveSupport::OrderedOptions.new + config.eager_load_namespaces << I18n + # Set the i18n configuration after initialization since a lot of # configuration is still usually done in application initializers. config.after_initialize do |app| -- GitLab