mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-11 22:24:21 +01:00
15 lines
335 B
Ruby
15 lines
335 B
Ruby
# frozen_string_literal: true
|
|
|
|
# module definition
|
|
module FabManager::Middleware; end
|
|
|
|
# Provides localization in workers
|
|
class FabManager::Middleware::ServerLocale
|
|
def call(_worker_class, job, _queue)
|
|
locale = job['locale'] || Rails.application.secrets.rails_locale
|
|
I18n.with_locale(locale) do
|
|
yield
|
|
end
|
|
end
|
|
end
|