-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
human_attribute_name will does not work on ActiveType objects when using gettext_i18n_rails #188
Comments
Both gems certainly hook into translations for their own reasons, I'm not suprised this leads to issues. However, since none of us use Gettext, it's not likely we will look into this anytime soon; if it turns out we can reasonably fix this in ActiveType we would of course accept a PR for this. |
Thank you for your reply! I'll see if I can figure out something useful in the coming weeks. |
Hey, @kratob! What's your translation approach when you generate forms with ActiveType objects? Best regards! |
@kdiogenes When using regular |
Expanding a bit on @kratob's comment, because it isn't well documented in Rails: If you have
|
I was thinking about using |
ActiveType imitates regular Rails models almost perfectly. However, I've run into a situation where that is not the case:
active_type (2.5.0)
gettext_i18n_rails (1.12.0)
While
MyModel.human_attribute_name(:my_attr)
works fine on regular models configured the same way, the translation is not actually looked up, but "My attr" is printed instead.Presented the choice whether to report this issue to gettext or active_type, I went the latter, as active_type AFAIK aims to imitate ActiveModel and the behavior differs from a regular model.
Thanks a lot in advance for looking into this! Let me know if I can help detailing this better.
The text was updated successfully, but these errors were encountered: