I18n::InvalidLocale if set config.i18n.default_locale to other language
if set config.i18n.default_locale
in config/application.rb
gitlab failed , the message below
gitlab_1 | ================================================================================
gitlab_1 | Error executing action `run` on resource 'execute[clear the gitlab-rails cache]'
gitlab_1 | ================================================================================
gitlab_1 |
gitlab_1 | Mixlib::ShellOut::ShellCommandFailed
gitlab_1 | ------------------------------------
gitlab_1 | Expected process to exit with [0], but received '1'
gitlab_1 | ---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
gitlab_1 | STDOUT:
gitlab_1 | STDERR: rake aborted!
gitlab_1 | I18n::InvalidLocale: :"zh-CN" is not a valid locale
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/protected_ref.rb:30:in `block in protected_ref_access_levels'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/protected_ref.rb:21:in `each'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/protected_ref.rb:21:in `protected_ref_access_levels'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/app/models/protected_branch.rb:7:in `<class:ProtectedBranch>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/app/models/protected_branch.rb:3:in `<top (required)>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/protected_branches.rb:49:in `block (2 levels) in <class:ProtectedBranches>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/protected_branches.rb:46:in `block in <class:ProtectedBranches>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/protected_branches.rb:14:in `<class:ProtectedBranches>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/protected_branches.rb:4:in `<module:API>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/protected_branches.rb:3:in `<top (required)>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:136:in `<class:API>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:4:in `<module:API>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:3:in `<top (required)>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/config/initializers/rack_attack.rb:12:in `<top (required)>'
gitlab_1 | /opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:11:in `<top (required)>'
gitlab_1 | /opt/gitlab/embedded/bin/bundle:23:in `load'
gitlab_1 | /opt/gitlab/embedded/bin/bundle:23:in `<main>'
gitlab_1 | Tasks: TOP => cache:clear => cache:clear:redis => environment
gitlab_1 | (See full trace by running task with --trace)
gitlab_1 | ---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
gitlab_1 | Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1
the reason is some third party dependency will check available_locales. and config.i18n.enforce_available_locales doesn't take effect.
the the setting can skip by setting I18n.config.enforce_available_locales = false
related to MR #197 (closed)
so can we add this setting?
Edited by Benson