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, &block) ⇒ Object


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

def call(_worker, msg, _queue, &block)
  I18n.with_locale(msg.fetch("locale", I18n.default_locale), &block)
end