Argument Error


#1

I used this guide: guides.rubyonrails.org/i18n.html to localize my
sample application

i’ve set config/environment.rb, controllers/application.rb as it is
written in the article

#views/home/index.html.erb

<%=t :hello_world %>

but when I start application the following error occurs:

ArgumentError in Home#index
Showing app/views/home/index.html.erb where line #1 raised:

How to avoid this error?

I’m using Mongrel/Apache and my rails configuration is:

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 1.3.1
Rails version 2.2.2
Active Record version 2.2.2
Action Pack version 2.2.2
Active Resource version 2.2.2
Action Mailer version 2.2.2
Active Support version 2.2.2

Please, help me :slight_smile:


#2

I forgot to say:
#config/locales/en.yml
en:
hello_world: “Hello world”

#config/locales/es.yml
es:
hello_world: “Hola Mundo”

ArgumentError in Home#index

Showing app/views/home/index.html.erb where line #1 raised:

syntax error on line 1, col 13: ` hello_world: “Hola Mundo”’
Extracted source (around line #1):

1:

<%=t :hello_world %>


RAILS_ROOT: C:/ir/rails_apps/new

C:/ir/ruby/lib/ruby/1.8/yaml.rb:133:in load' C:/ir/ruby/lib/ruby/1.8/yaml.rb:133:inload’
C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:191:in
load_yml' C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:178:insend’
C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:178:in
load_file' C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:inload_translations’
C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:in
each' C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:13:inload_translations’
C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:79:in
init_translations' C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:94:inlookup’
C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb:33:in
translate' C:/ir/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/vendor/i18n-0.0.1/i18n.rb:160:intranslate’
C:/ir/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/helpers/translation_helper.rb:8:in
`t’
app/views/home/index.html.erb:1