From 686a8f3af919d8f93dce0c253f1c0b3f81d98bc3 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 2 Aug 2017 10:44:55 +1000 Subject: [PATCH] Add legacy and default values for LOCALE This makes sure there is a value in `config.i18n.available_locales` so that i18n-js doesn't crash. --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 189170abdd..cc402859da 100644 --- a/config/application.rb +++ b/config/application.rb @@ -70,7 +70,7 @@ 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"] + config.i18n.default_locale = ENV["LOCALE"] || ENV["I18N_LOCALE"] || "en" config.i18n.available_locales = ENV["AVAILABLE_LOCALES"].andand.split(',').andand.map(&:strip) || [config.i18n.default_locale] I18n.locale = config.i18n.locale = config.i18n.default_locale