ruby-i18n / i18n

Internationalization (i18n) library for Ruby
MIT License
986 stars 411 forks source link

Fix missing requires of i18n/core_ext/hash #574

Closed razum2um closed 2 years ago

razum2um commented 3 years ago

If you try to build a custom i18n backend using chain in a rails initialiser it requires only chain file but breaks with uninitialized constant I18n::HashRefinements

This cannot be reproduced during just rake test because file gets loaded, but I added explicit requires to test to reproduce failure if you stash lib changes:

$ rake test TEST=test/backend/chain_test.rb                                                                                                                                                     ​
...
i18n/lib/i18n/backend/chain.rb:20:in `<class:Chain>': uninitialized constant I18n::HashRefinements (NameError)
    from i18n/lib/i18n/backend/chain.rb:19:in `<module:Backend>'
      ​....
rake aborted!
...

same for rake test TEST=test/gettext/backend_test.rb