Forum: Rails I18n I can't make i18n work on rails

Fb7892edf94cd41f5e6fd8d1f98f03fa?d=identicon&s=25 Omar Rodriguez (Guest)
on 2010-01-22 07:28
(Received via mailing list)
Hi,

I'm following this guide http://guides.rubyonrails.org/i18n.html

but I can't make it works.

it says: "Rails adds all .rb and .yml files from the config/locales
directory to your translations load path, automatically. The default
en.yml locale in this directory contains a sample pair of translation
strings"

firstly when I create a rails app using the rails command it doesn't
not create nether a config/locales directory nor en.yml file.

secondly I want to change default language, I added this line to
enviroment.rb as the guide says

config.i18n.default_locale = :en

but it gives me an error: undefined method `i18n' for
#<Rails::Configuration:0xb78ac64c>

Please I need a hand with this.
4a551074ddba4460f95d011c47190d0e?d=identicon&s=25 Henrik --- (malesca)
on 2010-01-22 07:40
(Received via mailing list)
On Fri, Jan 22, 2010 at 01:19, Omar Rodriguez <omarjavier15@gmail.com>
wrote:
> firstly when I create a rails app using the rails command it doesn't
> not create nether a config/locales directory nor en.yml file.

I just tried generating a new Rails app with Rails 2.3.5. I got a
config/locales/en.yml file.

> secondly I want to change default language, I added this line to
> enviroment.rb as the guide says
>
> config.i18n.default_locale = :en
>
> but it gives me an error: undefined method `i18n' for
> #<Rails::Configuration:0xb78ac64c>

Works fine for me. What Rails version are you using? Does the top if
yopur environment.rb file say

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION

?
Fb7892edf94cd41f5e6fd8d1f98f03fa?d=identicon&s=25 Omar Rodriguez (Guest)
on 2010-01-30 23:01
(Received via mailing list)
mine says:

RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION

this should be the problem, aparrently rails command used without
version argument uses 2.1.0 as default.

Thanks a lot Henrik!
Ad80ef30dd1243ebc48f4de359fb01ce?d=identicon&s=25 Justin MacCarthy (Guest)
on 2010-02-01 04:09
(Received via mailing list)
You need to run gem update to get a later version of rails

Justin
Fb7892edf94cd41f5e6fd8d1f98f03fa?d=identicon&s=25 Omar Rodriguez (Guest)
on 2010-02-01 16:32
(Received via mailing list)
I still have problems,

I did gem update, then gem list looks like this:

$ gem list

*** LOCAL GEMS ***

...
rails (2.3.5, 2.3.4)
...

Despite it, when a do rails project-name, the config/enviroment.rb has
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION.

I have netbeans6.8 installed, I don't know if it has its own version
of rails and in somehow is replacing 2.3.5 ...

Thanks
Adce10d7f1dbabcdab8f525a59cec32f?d=identicon&s=25 Andrés Gutiérrez (andresgutgon)
on 2010-02-01 16:38
(Received via mailing list)
Your top enviroment.rb says this:
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION.

Should say this:
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION.

Change it.

2010/2/1 Omar Rodriguez <omarjavier15@gmail.com>

> ...
> On Jan 31, 11:08 pm, Justin MacCarthy <jus...@maccarthy.org> wrote:
> > > this should be the problem, aparrently rails command used without
> > >> I just tried generating a new Rails app with Rails 2.3.5. I got a
> > >> Works fine for me. What Rails version are you using? Does the top if
> Groups "rails-i18n" group.
> You received this message because you are subscribed to the Google Groups
> "rails-i18n" group.
> To post to this group, send email to rails-i18n@googlegroups.com.
> To unsubscribe from this group, send email to
> rails-i18n+unsubscribe@googlegroups.com<rails-i18n%2Bunsubscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/rails-i18n?hl=en.
>
>


--
Experiencia es lo que obtienes, cuando no obtienes lo que quieres.
This topic is locked and can not be replied to.