Skip to content

I18n::InvalidLocale error when :en is not included in config.i18n.available_locales#70

Description

@BarnabeD

It's not a bug, but possibly a new feature! 馃槃

My issue:

I'm building a French-only application with solid_errors and I get this error I18n::InvalidLocale.
My application will be available in different languages, but for now, the only locale available is :fr.
In solid_errors the locale is forced in the ErrorsController by around_action :force_english_locale!

I patched it with this initializer, added the locale keys to my locale file and everything works fine:

Rails.application.config.to_prepare do
  SolidErrors::ErrorsController.class_eval do
    skip_around_action :force_english_locale!
  end
end

My suggestions:

I think about two solutions :

  • Changing the hardcoded :en locale and rely on the application's default locale.
  • Add the SolidErrors configuration to manually set the locale with :en as fallback.

Let me know if this feature catches your attention, I'm ready to help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions