From 01bf64e6b03658424b9cd547dc6dc2cccdda669f Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 7 Jan 2016 07:15:18 +0100 Subject: [PATCH] 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 --- config/application.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 8a492f5121..55bf36ad86 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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