From benjamin.meichsner at googlemail.com Wed Apr 8 11:58:35 2009 From: benjamin.meichsner at googlemail.com (Benjamin Meichsner) Date: Wed, 8 Apr 2009 17:58:35 +0200 Subject: [Rails I18n] Localization problem in nested-attributes validation Message-ID: <859180f591fafcacf08f6574bb6a323f@ruby-forum.com> Hey, I recently run into a problem with the new feature for activerecord: nested attributes. When the nested object (Activist) is invalid, the error messages are shown, but the object name is noch translated. (My project is in german) So I get int the error box: "Bitte ?berpr?fen Sie die folgenden Felder: * Activist surename muss ausgef?llt werden * Activist city muss ausgef?llt werden" In my appropriate localization file (de.yml) I defined the object/ attributes names correctly. de: activerecord: models: protest_mail: Protestmail activist: Aktivistin attributes: protest_mail: subject: Betreff body: Inhalt activist: surename: Nachname city: Stadt The error messages for protest_mail are transalated correctly, so I guess, the problems applies to the new nested-attributes feature. Any idea how to fix this? best regards, benni -- Posted via http://www.ruby-forum.com/. From akute at akute.ru Mon Apr 13 13:00:43 2009 From: akute at akute.ru (Anton Korbutyak) Date: Mon, 13 Apr 2009 19:00:43 +0200 Subject: [Rails I18n] Argument Error Message-ID: 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 :-) -- Posted via http://www.ruby-forum.com/. From akute at akute.ru Mon Apr 13 13:03:53 2009 From: akute at akute.ru (Anton Korbutyak) Date: Mon, 13 Apr 2009 19:03:53 +0200 Subject: [Rails I18n] Argument Error In-Reply-To: References: Message-ID: <2554154dbbbf0efa98e012afc52098b9@ruby-forum.com> 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:in `load' 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:in `send' 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:in `load_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:in `load_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:in `lookup' 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:in `translate' 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 -- Posted via http://www.ruby-forum.com/.