c2b195e1e3
When development tools try to load Rails components, they sometimes end up loading files that will error out since a dependency is missing. In these cases, the tooling can catch the error and change its behaviour. However, since the warning is printed directly to `$stderr`, the tooling cannot catch and suppress it easily, which ends up causing noise in the output of the tool. This change makes Rails print these warnings using `Kernel#warn` instead, which can be suppressed by the tooling.
18 lines
558 B
Ruby
18 lines
558 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "active_support/core_ext/hash/deep_merge"
|
|
require "active_support/core_ext/hash/except"
|
|
require "active_support/core_ext/hash/slice"
|
|
begin
|
|
require "i18n"
|
|
require "i18n/backend/fallbacks"
|
|
rescue LoadError => e
|
|
warn "The i18n gem is not available. Please add it to your Gemfile and run bundle install"
|
|
raise e
|
|
end
|
|
require "active_support/lazy_load_hooks"
|
|
|
|
ActiveSupport.run_load_hooks(:i18n)
|
|
I18n.load_path << File.expand_path("locale/en.yml", __dir__)
|
|
I18n.load_path << File.expand_path("locale/en.rb", __dir__)
|