Code Monkey home page Code Monkey logo

Comments (3)

MichaelHoste avatar MichaelHoste commented on September 13, 2024

Hi @11mdlow,

Thank you for finding this issue and for the pull request!

My guess is that Pathnames should not be part of I18n.load_path. It seems to be an issue caused by https://github.com/dry-rb/dry-validation because I found another application having a similar problem: AlchemyCMS/alchemy_cms#1464

Maybe they fixed it in newer releases?

However, since it's a small fix that can avoid similar issues, I fixed it here: ed70149

It's the same approach as your pull request but I applied to_s higher in the stack. I also applied a uniq since you said that you noticed 2 similar paths in your project. Better be safe 😄

Could you please try using the master branch in your project and confirm that it works?

If so, I'll release a new version.

from rails.

11mdlow avatar 11mdlow commented on September 13, 2024

Hi @MichaelHoste, thanks for the quick response. That seems to have fixed it!

FWIW I suspect rails/i18n is doing something weird during app initialization when it sees a .yml file, because in both instances there is a direct reference to the file in the code. In dry-validation it's here: https://github.com/dry-rb/dry-validation/blob/e740dd270aa386163eda394d62546464903b690c/lib/dry/validation/constants.rb#L19. I think I18n allows Pathname objects, which is probably why it's never been addressed in that gem.

Anyways, thanks for the quick fix!

from rails.

MichaelHoste avatar MichaelHoste commented on September 13, 2024

Thank you for your feedback!

Since it seems to work, I released version 1.23 of the gem.

It's not clear from the I18n API if I18n.load_path accepts anything other than a String.
In doubt, using to_s is certainly a best practice when using it 😄

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.