Skip to content

Error with default locale not :en  #219

@baldarn

Description

@baldarn

hello,

i have default locale as :it. i have this error when accessing the jobs page:

MissionControl::Jobs::JobsControllerTest#test_get_jobs_and_job_details_when_the_default_locale_is_set_to_another_language_than_English:
I18n::InvalidLocale: :it is not a valid locale
    /home/baldarn/.local/share/mise/installs/ruby/3.3.1/lib64/ruby/gems/3.3.0/gems/i18n-1.14.6/lib/i18n.rb:382:in `enforce_available_locales!'

i tried monkeypatching the lib/mission_control/jobs/i18n_config.rb with

class MissionControl::Jobs::I18nConfig < ::I18n::Config
  def available_locales
    [ :it, :en ]
  end
end

and works, do you think there is a better way to achieve this? maybe fallbacking to :en locale if another locale is there

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions