You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a rails app with a config/seeds.rb task that populates the database with various records. Some of these records have a locale attribute which we validate against I18n.available_locales. In upgrading from rails 2.3.5 to 2.3.8 this seeds task broke, with the generated records complaining that the locale was invalid.
Firing up a console and calling I18n.available_locales returned all the locales as expected. Printing the available_locales from within the seeds task only returned [:en].
Much digging revealed that when the app is booted via a rake task the translations are being loaded before config/environment.rb is loaded (containing our custom i18n.load_path), with the call to #to_sentence in the recently added deprecation warning in rails/railties/lib/tasks/rails.rb being responsible for this premature call to I18n.translate. Removing this deprecation warning makes everything work again.
Anyone have any recommendations for how best to handle this issue?
Mac OS X 10.6.4
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
rails v2.3.8
i18n v0.4.1
The text was updated successfully, but these errors were encountered:
Send a patch to Rails and ask them to use join(", ") instead of to_sentence. Or update your plugins so the deprecation warnings is not exhibited anymore.
We have a rails app with a config/seeds.rb task that populates the database with various records. Some of these records have a
locale
attribute which we validate againstI18n.available_locales
. In upgrading from rails 2.3.5 to 2.3.8 thisseeds
task broke, with the generated records complaining that the locale was invalid.Firing up a console and calling
I18n.available_locales
returned all the locales as expected. Printing the available_locales from within the seeds task only returned[:en]
.Much digging revealed that when the app is booted via a rake task the translations are being loaded before
config/environment.rb
is loaded (containing our customi18n.load_path
), with the call to#to_sentence
in the recently added deprecation warning in rails/railties/lib/tasks/rails.rb being responsible for this premature call toI18n.translate
. Removing this deprecation warning makes everything work again.Anyone have any recommendations for how best to handle this issue?
Mac OS X 10.6.4
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
rails v2.3.8
i18n v0.4.1
The text was updated successfully, but these errors were encountered: