Class: Sidekiq::Middleware::I18n::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/middleware/i18n.rb

Overview

Pull the msg locale out and set the current thread to use it.

Instance Method Summary collapse

Instance Method Details

#call(worker, msg, queue) ⇒ Object



20
21
22
23
24
25
# File 'lib/sidekiq/middleware/i18n.rb', line 20

def call(worker, msg, queue)
  I18n.locale = msg['locale'] || I18n.default_locale
  yield
ensure
  I18n.locale = I18n.default_locale
end