Ensure en is an I18n fallback in all environments

Since `en` is considered as the main fallback for all locales
ensure that it is present in all environments.

Note: Setting `config.i18n.fallbacks` to `true` means use the default locale
which means that if a particular instance is not using an `en` based locale
(the parent `en` locale is automatically derived as a fallback) then `en` will
not be available as a fallback.
This commit is contained in:
Saimon Moore
2017-10-19 13:10:54 +02:00
committed by Rob H
parent 05d757e7c4
commit 610c2f9519
4 changed files with 5 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ Openfoodnetwork::Application.configure do
# Expands the lines which load the assets
config.assets.debug = false
config.i18n.fallbacks = [:en]
# Show emails using Letter Opener
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.default_url_options = { host: "0.0.0.0:3000" }

View File

@@ -56,7 +56,7 @@ Openfoodnetwork::Application.configure do
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = [:en]
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

View File

@@ -56,7 +56,7 @@ Openfoodnetwork::Application.configure do
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
config.i18n.fallbacks = [:en]
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

View File

@@ -36,6 +36,7 @@ Openfoodnetwork::Application.configure do
# Tests assume English text on the site.
config.i18n.default_locale = "en"
config.i18n.available_locales = ['en', 'es']
config.i18n.fallbacks = [:en]
I18n.locale = config.i18n.locale = config.i18n.default_locale
# Use SQL instead of Active Record's schema dumper when creating the test database.