Amit Rana wrote: > hi, > > I get the point. > > The reason I asked this is because I have a function to create a label > and set its contents based on the parameter passed to it. Now, I have to > call tr() everytime I pass the parameter. Instead, if I know that > whatever is passed is a string, so I just need to call tr() inside the > createlabel function and it could get localized. > > pretty strange that tr() function cannot identify the content of the 1st > parameter as a string ? >
Just a short answer, since I'm in a hurry: tr() is used in two ways. The *second* way is to run at run time (in the browser) and return a translated (and probably string-expanded) string for a key. That would work nicely with variables. The *first* use, though, is during build time, where the source code is scanned lexically for calls to tr(), and the first parameter is used as a key to create/update an entry in a .po file on disk (which then a human translator can use). Since this is static code analysis, there is no way of knowing runtime values of variables. Thomas ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
