Posted over 5 years ago. Visible to the public.

Use the same translations for ActiveRecord and ActiveModel

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

Copy
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

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Henning Koch
Last edit:
over 5 years ago
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more