I have set up a my application with spanish and english. On my console i am getting error messages in english if object is returning validation error. I want to set my rails console so i will get validation error message in spanish.
Getting this error.C:\projects\CyncErp>ruby script/consoleLoading development environment (Rails 2.3.8)>> I18.locale = 'es'NameError: uninitialized constant I18 from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in `load_missing_constant' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in `const_missing' from (irb):1
krunal shah
2010-08-17 15:10:45
You've missed the `n` off `I18n`
Shadwell
2010-08-17 15:18:45
@Shadwell Now it's not returning error but still validation messages are coming in english.
krunal shah
2010-08-17 15:25:50
Hmmm, okay, works for me I'm afraid so might not be able to help. For example `User.create!` after `I18n.locale = 'es'` gives me a load of missing translation messages like : `ActiveRecord::RecordInvalid: Validation failed: Password confirmation translation missing: es, activerecord, errors, models, user, attributes, password_confirmation, blank`
Shadwell
2010-08-17 15:38:05
Just wondering: you have got spanish translations in your application, right? They won't magically appear unless you've provided them. There are a load of sample rails translations here: http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale
Shadwell
2010-08-17 15:40:28
@Shadwell Thanks. i missed some configuration.
krunal shah
2010-08-17 19:10:05