discourse/config/initializers/100-i18n.rb
Sam c04bcf8655 PERF: move message bus to the front of the middleware stack
Organise all initializers so they are properly ordered and use the same naming scheme
2015-12-07 14:51:24 +11:00

10 lines
310 B
Ruby

# order: after 02-freedom_patches.rb
require 'i18n/backend/discourse_i18n'
I18n.backend = I18n::Backend::DiscourseI18n.new
I18n.config.missing_interpolation_argument_handler = proc { throw(:exception) }
I18n.init_accelerator!
unless Rails.env.test?
MessageBus.subscribe("/i18n-flush") { I18n.reload! }
end