Permalink
Browse files

Adding forced-load of I18n to ensure translations are loaded before m…

…odels. Thanks to Dr Mark Lane
  • Loading branch information...
1 parent eaedab8 commit 897671c2fdfb4093422352d8cab774cf8e9f2b8d @pat pat committed May 9, 2009
Showing with 9 additions and 0 deletions.
  1. +1 −0 README.textile
  2. +8 −0 rails/init.rb
View
@@ -121,3 +121,4 @@ Since I first released this library, there's been quite a few people who have su
* Max Lapshin
* Martin Emde
* David Wennergren
+* Mark Lane
View
@@ -2,5 +2,13 @@
require 'action_controller/dispatcher'
ActionController::Dispatcher.to_prepare :thinking_sphinx do
+ # Force internationalisation to be loaded.
+ if Rails::VERSION::STRING.to_f > 2.2
+ I18n.backend.reload!
+ I18n.backend.available_locales
+ elsif Rails::VERSION::STRING.to_f > 2.1
+ I18n.backend.load_translations(*I18n.load_path)
+ end
+
ThinkingSphinx::Configuration.instance.load_models
end

0 comments on commit 897671c

Please sign in to comment.