Home > Software engineering >  What is equivalent to `Rails.config.action_view.raise_on_missing_translations` in rails 7?
What is equivalent to `Rails.config.action_view.raise_on_missing_translations` in rails 7?

Time:12-23

I like to turn this on in my rails app configuration:

Rails.config.action_view.raise_on_missing_translations = true

Nonetheless, I realized this has been deprecated. What would be equivalent?

CodePudding user response:

From the Rails 6.1 release notes:

  • Deprecate config.action_view.raise_on_missing_translations in favor of config.i18n.raise_on_missing_translations.

    New generalized configuration option now determines whether an error should be raised for missing translations in controllers and views.

You should be able to say this instead:

config.i18n.raise_on_missing_translations = true

Rails 7 removes the deprecated configuration option:

6.1 Removals

  • Remove deprecated Rails.config.action_view.raise_on_missing_translations
  • Related