[This fix is directly ported from alavetelitheme.]
Even on a very fast computer, there is a significant delay (a couple
of seconds) in processing every request in development mode. This
is because the configuration of FastGettext's paths for finding
translations is done in a block passed to
Rails.configuration.to_prepare, which causes the block to be run
before every request by the Rails Reloader in developmetn mode.
It seems to be work fine just running the FastGettext calls on
initialization in development mode, however - customizations in
the theme's locale-theme directory still have effect in
development mode even after the reloader has reloaded classes
before handling subsequent requests. So, I think this change
should be safe. This commit introduces that change, having the
effect that development mode is much more responsive.
[This fix is directly ported from alavetelitheme.]
Even on a very fast computer, there is a significant delay (a couple of seconds) in processing every request in development mode. This is because the configuration of FastGettext's paths for finding translations is done in a block passed to Rails.configuration.to_prepare, which causes the block to be run before every request by the Rails Reloader in developmetn mode.
It seems to be work fine just running the FastGettext calls on initialization in development mode, however - customizations in the theme's locale-theme directory still have effect in development mode even after the reloader has reloaded classes before handling subsequent requests. So, I think this change should be safe. This commit introduces that change, having the effect that development mode is much more responsive.