Allow delayed_job to use the locale defined for application

delayed_job requires a different configuration variable for locale than
the application.

See
https://stackoverflow.com/questions/8478597/rails-3-set-i18n-locale-is-not-working
for reference
This commit is contained in:
Christian
2016-01-07 07:15:18 +01:00
parent 839bf8794f
commit 01bf64e6b0

View File

@@ -66,7 +66,8 @@ module Openfoodnetwork
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = ENV["LOCALE"]
I18n.locale = config.i18n.locale = config.i18n.default_locale
# Setting this to true causes a performance regression in Rails 3.2.17
# When we're on a version with the fix below, we can set it to true
# https://github.com/svenfuchs/i18n/issues/230