Ok - I see this is NOT an accurate assessment (but it is a little obtuse for
looking at code);

I caught the comments in README ("gluon.storage objects are now translated
without T"), and meandered my way to the translator and lazyT classes in
languages.py, and the one line environment setup of 'T' in
compileapp.py/build_environment()

Ok - I believe you ... it does this now.

So, to focus back on this thread a little:

sulato:

You can rename the labels for first_name and last_name as you like in your
application.  To see all those labels translated (e.g. into Japanese), all
you will need to do is provide the translations for the strings in
auth.messages in a translation file - that should be it.

We should probably add some comments in context from the readme into
storage.py (once you know what you're looking at, then you can see that in
class Messages(),  the line:


     return str(self['T'](value))

implicitly calls the __call__() method of the translator class - this really
deserves a comment here, and probably at the head of the message section(s)
in tools.py (that looks to be all).

Massimo - ok if I add some brief comments and send a patch?

- Yarko

On Sat, Aug 8, 2009 at 6:33 PM, Yarko Tymciurak <yark...@gmail.com> wrote:

> to clarify, it doesn't look to me like the default auth messages are
> translatable unless the application author re-assigns them with T()
> strings...
>
> Is that an accurate assesment?
>
> By lazy-assignment, I meant delayed processing of T() so that it picks up
> the session settings;  as it is, I see no default T() of the messages
> anywhere...
>
>
> On Sat, Aug 8, 2009 at 6:31 PM, Yarko Tymciurak <yark...@gmail.com> wrote:
>
>> On Sat, Aug 8, 2009 at 6:19 PM, mdipierro <mdipie...@cs.depaul.edu>wrote:
>>
>>>
>>>
>>> > I wonder if some sort of lazy message assignment/translation would be
>>> > reasonable / possible..
>>>
>>> Already in trunk. ;-)
>>
>>
>> Hmmmm..... this is not obvious to me...  for example,  how is translation
>> handled for the messages?
>>
>> even after this post, and searching thru the code, I look at (for
>> example)  tools.py: Auth.retrieve_password(): line 1161:
>>
>> session.flash = self.messages.email_sent
>>
>> and nowhere do I see a re-assignment or opportunity for the
>> messages.email_sent message to get T()'ified;
>>
>> Am I missing something?
>>
>>
>>> >>>
>>>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to