DRY language fallback config

This commit is contained in:
Maikel Linke
2026-03-18 13:58:17 +11:00
parent 63988fff4f
commit 1696dd2de6
5 changed files with 5 additions and 15 deletions

View File

@@ -158,12 +158,15 @@ module Openfoodnetwork
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# 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]
# The default locale is set in the environment.
config.i18n.default_locale = OpenFoodNetwork::I18nConfig.default_locale
config.i18n.available_locales = OpenFoodNetwork::I18nConfig.available_locales
I18n.locale = config.i18n.locale = config.i18n.default_locale
# 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]
# Calculate digests for locale files so we can know when they change
I18nDigests.build_digests config.i18n.available_locales

View File

@@ -111,8 +111,6 @@ Rails.application.configure do
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
config.i18n.fallbacks = [:en]
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true

View File

@@ -91,10 +91,6 @@ Rails.application.configure do
# Use https in email links
config.action_mailer.default_url_options = { protocol: 'https' }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = [:en]
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

View File

@@ -60,10 +60,6 @@ Openfoodnetwork::Application.configure do
# Enable threaded mode
# config.threadsafe!
# 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]
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end

View File

@@ -89,9 +89,6 @@ Rails.application.configure do
# Raises error for missing translations.
config.i18n.raise_on_missing_translations = true
# Tests assume English text on the site.
config.i18n.fallbacks = [:en]
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true