Translatable string inside jquery selector

28 views
Skip to first unread message

Ruud Schroen

unread,
Jan 9, 2014, 6:31:40 PM1/9/14
to web...@googlegroups.com
I have a translatable string inside a jquery selector. I properly escaped the single quotes cause i don't get an error from jquery. 

$("#resultemail").removeClass().addClass('error').text('{{=T("Sorry, we don\\'t know you...")}}').fadeTo(900,1);

But the string is not showing up in my language file, why?

Note: not sure if it matters, but the string is inside a ajax function (the error part) 
 

weheh

unread,
Jan 9, 2014, 10:33:47 PM1/9/14
to web...@googlegroups.com
I believe you will have to execute the jquery selector at least once before your string will appear in the language file.

Anthony

unread,
Jan 9, 2014, 10:42:08 PM1/9/14
to web...@googlegroups.com
In what view file is that line, and has that view file been executed since adding that line?

Ruud Schroen

unread,
Jan 10, 2014, 2:17:53 AM1/10/14
to web...@googlegroups.com
In layout.html, and yes it has been executed several times. I even tried putting it outside the jquery and executing it, still no luck..


--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/vIyRDdnXk1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages