2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-07-15 11:04:45 -05:00
|
|
|
# order: after 02-freedom_patches.rb
|
|
|
|
|
2015-11-13 14:42:01 -06:00
|
|
|
require 'i18n/backend/discourse_i18n'
|
2018-01-22 07:42:12 -06:00
|
|
|
require 'i18n/backend/fallback_locale_list'
|
|
|
|
|
2015-11-13 14:42:01 -06:00
|
|
|
I18n.backend = I18n::Backend::DiscourseI18n.new
|
2018-01-22 07:42:12 -06:00
|
|
|
I18n.fallbacks = I18n::Backend::FallbackLocaleList.new
|
2015-09-02 14:28:50 -05:00
|
|
|
I18n.config.missing_interpolation_argument_handler = proc { throw(:exception) }
|
2019-04-29 02:12:47 -05:00
|
|
|
I18n.reload!
|
2015-11-23 15:45:05 -06:00
|
|
|
I18n.init_accelerator!
|
2015-11-17 15:14:42 -06:00
|
|
|
|
2015-11-23 15:45:05 -06:00
|
|
|
unless Rails.env.test?
|
2019-11-04 19:15:44 -06:00
|
|
|
MessageBus.subscribe("/i18n-flush") do
|
|
|
|
I18n.reload!
|
|
|
|
ExtraLocalesController.clear_cache!
|
|
|
|
end
|
2015-11-23 15:45:05 -06:00
|
|
|
end
|