Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load custom locales after everything is loaded #3663

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Jul 15, 2019

Background

The line:

config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}")]

Was adding every locale under the config/locales folder, including the ones inside config/locales/custom/. The files were loaded in the same order as listed using ls -f.

So if the custom locales were loaded before the folder config/locales/#{I18n.locale}, the default locales would override the custom ones, and we want the custom locales to override the default
ones so CONSUL is easier to customize.

Objectives

Make sure custom locales are loaded after every other locale is loaded.

The line:

```
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**", "*.{rb,yml}")]
```

Was adding every locale under the `config/locales` folder, including the
ones inside `config/locales/custom/`. The files were loaded in the same
order as listed using `ls -f`.

So if the custom locales were loaded before the folder
`config/locales/#{I18n.locale}`, the default locales would override the
custom ones, and we want the custom locales to override the default
ones so CONSUL is easier to customize.
@javierm
Copy link
Member Author

javierm commented Aug 7, 2019

Travis failure is not related to this pull request and will be fixed by #3661.

@javierm javierm merged commit 5ade66d into master Aug 7, 2019
@javierm javierm deleted the custom_locales_check branch August 7, 2019 21:54
@javierm javierm added this to Release 1.1.0 in Roadmap Sep 10, 2019
@javierm javierm added the Bug label Sep 11, 2019
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Load custom locales after everything is loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

None yet

1 participant