Search code examples
javascriptinternationalizationruby-on-rails-2

i18n-js on Rails 2.3.5 installation


I feel like a moron because this gem seems to be a widely used, but I can't set it up.

I'm on the i18n-js github page and I'm following the instructions:

gem install i18n-js
rake i18n:js:setup # Rails <= 3.0

And, though the gem is is now installed, I get:

Don't know how to build task 'i18n:js:setup'

Which it's actually no big surprise because I don't think it's enough to have the gem in your gemlist to add some task, right?

I also tried adding this line below, but, though the gem it's now shown as a dependency and I can access SimplesIdeias::I18n, the rake task is still not available.

# environment.rb
config.gem 'i18n-js'

What am I doing wrong?

Thanks


Solution

  • Add in your Rakefile :

    require 'i18n-js'
    require 'i18n-js/rake'
    

    After you have this rake task.

    If you see the rake task : https://github.com/fnando/i18n-js/blob/master/lib/i18n-js/rake.rb

    You can emulate this task in your console and do :

    SimplesIdeias::I18n.setup!