Skip to content

Commit

Permalink
Adding forced-load of I18n to ensure translations are loaded before m…
Browse files Browse the repository at this point in the history
…odels. Thanks to Dr Mark Lane
  • Loading branch information
pat committed May 9, 2009
1 parent eaedab8 commit 897671c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -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
8 changes: 8 additions & 0 deletions rails/init.rb
Expand Up @@ -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.