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

Override locales and conflict with rails-i18n #847

Closed
julienanne opened this issue Feb 15, 2023 · 4 comments · Fixed by #850
Closed

Override locales and conflict with rails-i18n #847

julienanne opened this issue Feb 15, 2023 · 4 comments · Fixed by #850

Comments

@julienanne
Copy link
Contributor

Hello,
(sorry for my English)
First of all thanks for your work, very appreciate it.

In the navbar (app/views/good_job/shared/_navbar.erb) and maybe in other places (with other helpers), you have a call to number_to_human helper and in the good_job locales (at least fr.yml) you redefine the "number.human.decimal_units.format".

This locale key is used by the concerning helper and so you redefine the key for the whole project (in my case good_job seems loaded after rails-i18n https://github.com/svenfuchs/rails-i18n/blob/v7.0.6/rails/locale/fr.yml#L178 and override the concerning key).

The impact is not localized to Good Job maybe it can be possible (if you absolutely want to get a specific format),

  • to passed it to the number_to_human call instead of redefine the key in good job locale
  • or to make a Good Job helper to used other locales specific to Good job
    ?

Thanks again for your work.
If I have some times, can I make a PR ?

Have a nice day

Julien ANNE

@bensheldon
Copy link
Owner

@julienanne oh no! I'm sorry to have this gem override the translations for your own project.

Let me figure out how to get all of those translations into an appropriate namespace so they don't collide/override with your own projects.

@bensheldon
Copy link
Owner

Thank you for reporting this! Released a fix: https://github.com/bensheldon/good_job/releases/tag/v3.12.2

@julienanne
Copy link
Contributor Author

Thank you, you are moving so fast, very appreciate it ;)
I will perform an update ;)

Hope your project will continue for a long time.

Have a nice day
Julien

@julienanne
Copy link
Contributor Author

Again thank you the correction was perfect ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants