-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override i18n_key on ActiveRecord-derived classes
This allows creating translations for the derived classes themselves instead of polluting the base class translations. For this we need to create an ActiveModel::Name, which uses the parent class name, but derived class reference. We then override the i18n_key, but not the other ones, to override i18n lookup but keep the same parameter and route names. A test is added to ensure the behavior Fixes: #115
- Loading branch information
Showing
2 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters