Rails 2.3.5 model name translation problem in error messages

Posted by Jason Nerer on Stack Overflow See other posts from Stack Overflow or by Jason Nerer
Published on 2010-05-31T12:30:53Z Indexed on 2010/05/31 13:13 UTC
Read the original article Hit count: 490

Filed under:
|
|
|
|

Hi Rails'ers,

I encountered some problem while trying to translate my model's names and attributes in a Rails 2.3.5 app.

I have the following model:

class BillingPlan < ActiveRecord::Base

  validates_presence_of :billing_option_id

  belongs_to :order
  belongs_to :user
  belongs_to :billing_option
end

When validation fails, my models attributes are translated correctly, but the modelname itself is not. I use the following translation skeleton in de.yml

de:
  activerecord:
    models:
      shipping_plan: "Versandart"
      billing_plan: "Rechnungsart"
  attributes:
    shipping_plan:
      shipping_option_id: "Versandoption"
    billing_plan:
      billing_option_id: "Rechnungsoption"

Basis for my translation file is: http://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/de.yml

Can anyone help?

Thx in advance J.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about model