Skip to content

Commit

Permalink
Add legacy and default values for LOCALE
Browse files Browse the repository at this point in the history
This makes sure there is a value in `config.i18n.available_locales` so
that i18n-js doesn't crash.
  • Loading branch information
mkllnk committed Aug 2, 2017
1 parent 199bfe5 commit 686a8f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/application.rb
Expand Up @@ -70,7 +70,7 @@ class Application < Rails::Application

# 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

Expand Down

0 comments on commit 686a8f3

Please sign in to comment.