well, you are using that quite wrong.
You are trying to have javascript call a web2py built in function. Not a 
way to do that without writing a function around that and then is it even 
worth it?
Why exactly do you want to get the translated text via javascript? web2py 
doesn't automatically translate anything that isn't defined beforehand.

On Sunday, May 4, 2014 8:01:40 AM UTC-7, lula bad wrote:
>
> Hi,
>
> i have the following problem.
>
> I have a javascript funktion inside a <script> Tag inside the index.html
> Function is:
>
>     var set_info_text = function (txt) {
>         $('#info_text').innerHTML = '{{=T(txt)}}';
>     };
>
> usage is: 
>
> set_info_text('number peers online');
>
>
> I get this errormessage:
>
> Traceback (most recent call last):
>  File 
> "C:\Users\afieg\PycharmProjects\web2py_projekte\web2py\gluon\restricted.py", 
> line 220, in restricted
>  exec ccode in environment
>  File 
> "C:\Users\afieg\PycharmProjects\web2py_projekte\web2py\applications\yacystats2\views\default/index.html",
>  line 40, in <module>
>  <input id="search_peer" class="form-control input-lg" type="search" 
> placeholder="Name or Hash"/>
> NameError: name 'txt' is not defined
>
> I didnt found any solution yet, or is there another way to translate?
>
> Thanks.
>
>

-- 
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/d/optout.

Reply via email to