grosser / gettext_i18n_rails

Rails: FastGettext, I18n integration -- simple, threadsafe and fast!
MIT License
268 stars 90 forks source link

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

Open dfguo opened 9 years ago

dfguo commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

nice! Thanks!

marnen commented 9 years ago

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 commented 9 years ago

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 commented 1 year ago

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