Skip to content
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

what's the reason for forcing model attributes to use gettext? #128

Open
dfguo opened this issue Nov 27, 2014 · 5 comments
Open

what's the reason for forcing model attributes to use gettext? #128

dfguo opened this issue Nov 27, 2014 · 5 comments

Comments

@dfguo
Copy link

dfguo commented Nov 27, 2014

The model attribute is translated using gettext while the error message is translated using i18n. Is there any reason why the attributes can't be translated using i18n?

@arp242
Copy link

arp242 commented Dec 30, 2014

It's not forced; you can turn if off by doing this in config/application.rb:

config.gettext_i18n_rails.use_for_active_record_attributes = false

This could definitely be documented better, though ... It took me a trip to the source code to figure this out :-)

@dfguo
Copy link
Author

dfguo commented Jan 5, 2015

nice! Thanks!

@marnen
Copy link
Contributor

marnen commented Mar 11, 2015

Is there a way to do the reverse -- that is, use Gettext for the error message? I'd like to use Gettext for as much of my i18n as possible.

@marnen
Copy link
Contributor

marnen commented Mar 11, 2015

Ah, answering my own question, I see I can put the dot.key.path as a key into the PO file. Not great, but functional.

@icbd
Copy link

icbd commented Oct 13, 2022

I have a related question:

Error messages can be translated through FastGettext, if the ':message' is a translation-id.

Could you help explain how this is done? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants