Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Yes, I see. I'll try to replace the arguments I passed before to my JS function by JSON object. P.S. The difference is that in RoR you can embed Ruby code inside js files. -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-j

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Christian Köberl
Am 23.12.2011 17:05, schrieb Javix: > @Chris: thanks again and sorry for my tone of sharpness regarding the > community activity. > I watched JSON technics. As far as I got it, it is just a container to keep > your data, like a hash. So what is advantages to use it instead of > 'renderSupport.addSc

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
I see for the moment is just I would pass JSON object to my Jaavscript function instead of passing all the translations. But in the Javascript function I should do the same, - get the translations back. Am I right ? Or I got it wrong? Thks -- View this message in context: http://tapestry.1045711.n5

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
ntext: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp5094388p5097311.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-uns

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Thiago H. de Paula Figueiredo
On Fri, 23 Dec 2011 11:29:43 -0200, Javix wrote: Thank you for the info. Two more questions: 1. In the page TML the call to the abov JS fucntion was done in on 'IF' loadPath(); ... @BeginRender void addJsLibs() { if (error) { String js = String.format("loadPass(\"%s\

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
ample or tutorial steps how to implement JSON in Tapestry 5.1*, - I found nothing at all, neither in books nor on forums -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp5094388p5097184.html Sent from the Tapestry - User mailing l

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Thiago H. de Paula Figueiredo
On Fri, 23 Dec 2011 11:14:32 -0200, Javix wrote: AH, OK, I see. Thank you for the attention. As for JSON, I have no idea how to use it, especially when I'm on Tapestry 5.1.5 :( The JSON support hasn't changed for a long time, way before 5.1.0.5. -- Thiago H. de Paula Figueiredo Independent

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
AH, OK, I see. Thank you for the attention. As for JSON, I have no idea how to use it, especially when I'm on Tapestry 5.1.5 :( -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in-javascript-variables-jQuery-tp5094388p5097160.html Sent from the Tap

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Christian Köberl
2011-12-23 14:00, Javix: > Could you indicate where exactly I have to escape single quotes, please, > here: > > String js = String.format("loadPass('%s','%s','%s','%s','%s');", m1, m2, m3, > m4, m5); > > Thks Here is the generated output from your last mail: loadPass('Veuillez indiquer un nouv

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
Could you indicate where exactly I have to escape single quotes, please, here: String js = String.format("loadPass('%s','%s','%s','%s','%s');", m1, m2, m3, m4, m5); Thks -- View this message in context: http://tapestry.1045711.

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Christian Köberl
2011-12-23 13:01, Javix: > Sure it is not the best solution. Unfortunately, Tapestry is not able to do > it as flexible as it does Ruby on Rails. Yes, your solution is not the best one but the reason is not Tapestry! There are hundreds of components using JS in Tapestry libraries and all manage t

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
solution. Unfortunately, Tapestry is not able to do it as flexible as it does Ruby on Rails. And the community is not so active either. Thanks everybody who participated in this discussion. And good tapesrting :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/inject-i18-text-in

Re: inject i18 text in javascript variables (jQuery)

2011-12-23 Thread Javix
.closest('form').submit(); }catch(error){ } } }); } loadPass(m1,m2,m3,m4,m5); [/code] I think that when clicking on 'forgottenPassLink' my 5 transl

Fwd: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Sergueï Cambour
-- Forwarded message -- From: Sergueï Cambour Date: Thu, Dec 22, 2011 at 3:37 PM Subject: Re: inject i18 text in javascript variables (jQuery) To: "Thiago H. de Paula Figueiredo" Thanks for your help. I have some more questions: 1. Did you miss ';' in the ex

Re: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Thiago H. de Paula Figueiredo
On Thu, 22 Dec 2011 10:35:13 -0200, Sergueï Cambour wrote: Taking in account that the number of classes to modify, I think I'll choose the first solution, - using RenderSupport. In this case, I should remove all the calls to the same js function from all the pages, right? Because it's up

Re: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Sergueï Cambour
Thanks a lot for your replies. It is not so clear for me for the moment. I'm on Tapestry 5.1. In all the 'tml' pages there are calls to some js functions which all are in separate js files, like that, for example: -

Re: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Christian Köberl
2011-12-22 12:31, Sergueï Cambour: > Is it possible to translate some javascript popup mesages by injection the > translated values from a 'tml' page into javascript function which is in a > separate js file? There are two options to localize your JavaScript: 1. add messages in the initializer cal

Re: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Sergueï Cambour
Thansk for the reply. I've already seen that code. The problem is that in that example a class Confirm was created in a javascript file: var Confirm = Class.create(); But as far as I know it is valid only for prototype and for jQuery as it's in my case. The js file uses jQuery. Any other idea? Th

Re: inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Paulo Ricardo Ribeiro
Hello I Have something like this: Delete So, i guess that, the same way I'm able to get the username, it's maybe possible to get a i18n message, and pass it to the javascript. (The mixin code is here: http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained) On Thu, Dec 22, 201

inject i18 text in javascript variables (jQuery)

2011-12-22 Thread Sergueï Cambour
Is it possible to translate some javascript popup mesages by injection the translated values from a 'tml' page into javascript function which is in a separate js file? Thanks