>
> I think we are talking about the same messages. When you wrote that
> "[gluon] messages are customizable via the API and translatable" I thought
> you were describing something more than the process of grabbing all T(x)s
> in gluon code and entering a translation for each x in file
> languages/<language-code>.py.
>
Yes, I was describing something more than that -- you can not only
translate those messages, but you can completely replace them with your own
via the API (without editing any gluon code). For example:
SQLFORM(...).process(message_onsuccess=T('Yippee, you submitted the form
correctly!'))
IS_IN_DB(..., error_message=T('Sorry, that value was not found.'))
auth.messages.registration_successful = T('Congratulations, you are now
registered.')
Not to mention that for any messages that are displayed via response.flash,
you can simply explicitly set the response.flash value directly, as in:
if form.process().accepted:
response.flash = 'Submission successful'
Incidentally, a script that extracts all such T()s from gluon files and
> builds a catalog of what needs to be translated would be quite useful. One
> shortcoming of the current translation process is that <language-code>.py
> files don't include the whole message catalog. Instead the message catalog
> grows dynamically as the various T()s in the code are executed. So there's
> no way to know a priori what translations are missing other than searching
> the gluon code for all T()s.
>
Not a bad idea.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.