Read more

Use the same translations for ActiveRecord and ActiveModel

Henning Koch
April 30, 2013Software engineer at makandra GmbH

ActiveRecord translations live in locale.activerecord. ActiveModel translations live in locale.activemodel. To use the same translations for both, use YAML references with & and *:

de:

  models: &models
    user: 'Benutzer'

  attributes: &attributes
    user:
      email: 'E-Mail'
      
  errors: &errors
    format: ! '%{attribute} %{message}'
    messages:
      accepted: muss akzeptiert werden
      blank: muss ausgefüllt werden
      # ...
      
  activerecord:
    errors: *errors
    models: *models
    attributes: *attributes

  activemodel:
    errors: *errors
    models: *models
    attributes: *attributes
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot
Posted by Henning Koch to makandra dev (2013-04-30 14:01)