i18n_router breaks rails 3.0.0.rc

5 views
Skip to first unread message

Stijnster

unread,
Jul 28, 2010, 5:42:46 AM7/28/10
to I18n Routing
Hi there,


after upgrading from rails 3.0.0.beta4 to rails 3.0.0.rc today I
noticed that I got some errors while booting the rails app. It seems
that a new functionality was added (the FileUpdateChecker) to check if
either the routing or I18n files are changed.

It does that by stat-ing the files in a path array it receives (please
see http://groups.google.com/group/rubyonrails-core/browse_thread/thread/b7955fe0d26afc6d
which is a thread that I started in the rails core group).

It turns out that the array constists of strings, but when the
i18n_routing plugin kicks in, it appends an additional string inside
the main string, containing some additional path information.

This happens around line 150 of the i18n_routing_rails3.rb file which
states;

I18n.load_path = (I18n.load_path << Dir[Rails.root.join('config',
'locales', '*.yml').to_s]).uniq

This results in an array within an array which finaly breaks the
file_update_checker file on line 25;

paths.map { |path| File.stat(path).mtime }.max


I changed the source of your plugin a bit to flatten out the array
before making it unqiue like this;

I18n.load_path = (I18n.load_path << Dir[Rails.root.join('config',
'locales', '*.yml')]).flatten.uniq


This makes all the errors go away. Could you please check if this
solution is solid enough and update the plugin? That would be awesome!


Thanks,


Stijn

Guillaume Luccisano

unread,
Jul 28, 2010, 6:26:53 AM7/28/10
to i18n-r...@googlegroups.com
Hello stijnster,

Thanks for noticing and solving that !
Unfortunately, I'm currently in vacation but I will be back at the end
of august and I will fix that.

Sorry for the big delay !

Stijn Mathysen // Telenet

unread,
Jul 28, 2010, 7:10:50 AM7/28/10
to i18n-r...@googlegroups.com
Hi Guillaume,

no problem! As long as it is getting in ;-)

Glad I can give back to open source!

Enjoy your holiday. I'll be spending mine in the South of France the last two weeks of august.

Reply all
Reply to author
Forward
0 new messages