I use I18n-js, and the client side I18n.t calls the entire returned message a missing translation at startup during production.
Everything is in order to develop and test.
The root of this problem seems to be in the asset pipeline.
I18n.load_path does not contain any of my translations (when running bin / rake assets: precompile) it contains only the following paths:
["/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activesupport-3.2.3/lib/active_support/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activemodel-3.2.3/lib/active_model/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activerecord-3.2.3/lib/active_record/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/actionpack-3.2.3/lib/action_view/locale/en.yml"]
They look like the default activesupport, activemodel, activerecord and actionpack gem transfers ...
My translation paths, however, are set as expected when starting the bin / rails console during development and production:
1.9.3p125 :002 > I18n.load_path => ["/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activesupport-3.2.3/lib/active_support/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activemodel-3.2.3/lib/active_model/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/activerecord-3.2.3/lib/active_record/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/actionpack-3.2.3/lib/action_view/locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/carrierwave-0.6.1/lib/carrierwave/validations/../locale/en.yml", "/home/chris/.rvm/gems/ ruby-1.9.3-p125@Project /gems/devise-2.0.4/config/locales/en.yml", "/media/sf_code/Project/config/locales/active_record.en.yml", "/media/sf_code/Project/config/locales/project.en.yml"]
In fact, the I18n documentation says: "Default language: en and all translations from config / locales / *. Rb, yml are automatically loaded."
I also tried specifying in application.rb
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
But there is still no joy.
Does anyone know what could cause the I18n.load_path parameter to not be set only when resources start: precompile?
Thanks for any ideas.