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.
This commit is contained in:
Maikel Linke
2017-08-02 10:44:55 +10:00
parent 199bfe531e
commit 686a8f3af9

View File

@@ -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