1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/lib/sidekiq/server_locale.rb
2023-03-22 17:30:37 +01:00

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