This project is archived and is in readonly mode.
Config option to prevent i18n.reload! on each request
-
Lawrence Pit
Btw, in rails 3 I18n.reload! is called twice on initialization in railtie.rb, namely in "i18n.initialize" and in the after_initialize. Not sure if any of the two could be removed.. it seems to me the call in the initialize block could be removed. What do you think?
-
José Valim
- Milestone cleared.
Hey Lawrence, a few notes. First, it would be nice if the new option you added simply delegates to config.cache_classes if it is not set. I think that less than 1% of people are going to use it, so it makes no sense being required to add it config/environments/*.rb.
Besides that, it looks great! Just one note, you don't need to update the patch for Rails 2.3, because I'm not willing to apply it on 2.3, since it's a maintenance branch.
-
Lawrence Pit
In development mode I do want to reload the classes on each request, just not all the i18n stuff, so delegating to cache_caches is not what I want.
I think > 90% don't do i18n, they just hard code all strings. So having i18n reload by default is just a waste for them.
-
José Valim
It's going to delegate to cache_classes unless it is set. The idea is to avoid configuration hell. If they are not using I18n at all, reloading it take few miliseconds just.
-
José Valim
We just changed I18n.reload! to be called only if any of the locale files were modified. This may have solved your problem!
-
Lawrence Pit
Brilliant! Thanks mate, like it a lot !
