[web2py] Re: Translation problem

2010-12-31 Thread DenesL
The problem is that those messages are defined internally in the validator and can not be set via error_message. An easy solution would be to wrap them in a T call but that results in: NameError: global name 'T' is not defined, line 188, in restricted So the question is why T can not be part of

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 8:54 AM, DenesL wrote: The problem is that those messages are defined internally in the validator and can not be set via error_message. Actually, they can, except that there's a bug for the first one, 'enter an integer' that needs to be fixed. An easy solution would

[web2py] Re: Translation problem

2010-12-31 Thread mdipierro
This is a complex issue. I have been experimenting with turning request, response, session, cache and T in thread local singletons. This will fixed a lot of the problem and would allow to create modules that use those variables without having to pass the explicitly. The issues are: - will

[web2py] Re: Translation problem

2010-12-31 Thread DenesL
On Dec 31, 12:23 pm, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2010, at 8:54 AM, DenesL wrote: The problem is that those messages are defined internally in the validator and can not be set via error_message. Actually, they can, except that there's a bug for the first one,

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 9:44 AM, DenesL wrote: On Dec 31, 12:23 pm, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2010, at 8:54 AM, DenesL wrote: = The problem is that those messages are defined internally in the validator and can not be set via error_message. Actually, they can,

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 9:43 AM, mdipierro wrote: This is a complex issue. I have been experimenting with turning request, response, session, cache and T in thread local singletons. This will fixed a lot of the problem and would allow to create modules that use those variables without

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 9:23 AM, Jonathan Lundell wrote: On Dec 31, 2010, at 8:54 AM, DenesL wrote: The problem is that those messages are defined internally in the validator and can not be set via error_message. Actually, they can, except that there's a bug for the first one, 'enter an

[web2py] Re: Translation problem

2010-12-31 Thread DenesL
On Dec 31, 2:34 pm, Jonathan Lundell jlund...@pobox.com wrote: On Dec 31, 2010, at 11:20 AM, Martin Weissenboeck wrote: No, I did not not want to translate these sentences manually. The error_message=T(..) does not work, because there are some if-statements inside the class

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 8:06 PM, DenesL wrote: The ideal solution would be one that allowed using T() normally in gluon (at least in code that's invoked from an application); that avoids the T=T requirement. My conjecture is when Python compiles the gluon code, it binds T references (to

Re: [web2py] Re: Translation problem

2010-12-31 Thread Jonathan Lundell
On Dec 31, 2010, at 8:06 PM, DenesL wrote: The ideal solution would be one that allowed using T() normally in gluon (at least in code that's invoked from an application); that avoids the T=T requirement. My conjecture is when Python compiles the gluon code, it binds T references (to