Closed huyderman closed 2 years ago
Thanks for raising the issue! Feel free to submit a PR. :)
Maybe I'm looking at this too simply. It seems that changing faker.rb:16 to
I18n.reload! if (I18n.backend.respond_to?(:initialized?) && I18n.backend.initialized?)
would have the same effect as the monkey patch. If so, I'm happy to submit a PR to that effect. The tests pass locally with that change in place. I ask because I'm not familiar with I18n, and don't want to introduce side effects.
That seems reasonable to me. It would be awesome if there was a test case that could reproduce the problem.
I spent some time trying to write a unit test for this, but was unable to find a way to isolate the backend change to a single test.
Hey, folks. In an effort to lighten our load as maintainers and be able to serve you better in the future, the faker-ruby team is working on cleaning out the cobwebs in this repo by pruning the backlog. As there are few of us, there are a lot of items that will simply never earn our attention in a reasonable time frame, and rather than giving you an empty promise, we think it makes more sense to focus on more recent issues. That means, unfortunately, that we must close this issue.
Don't take this the wrong way: our aim is not to diminish the effort people have made or dismiss problems that have been raised. If you feel that we should reopen this issue, then please let us know so that we can reprioritize it. Thanks!
Faker calls
I18n.reload! if I18n.backend.initialized?
to reload Faker translations. However, onlyI18n::Backend::Simple
implements#initialized?
, causing an error if I18n has been configured to use another backend (or backends throughI18n::Backend::Chain
).Example stack trace:
In my app, I use
I18n::Backend::Chain
to chain multiple backends, so to get Faker to work I monkey patched it like this:Needless to say, it would be nice to not have to monkey patch to use Faker.