Hi Alex,

thanks for answer, however the same happens with
qx.locale.Manager.tr(title). Later, I found this bug: 
http://bugzilla.qooxdoo.org/show_bug.cgi?id=2639

which I believe explains that I cannot use variables there... I also found
similar post, where is workaround like:
var atom = new qx.ui.basic.Atom(eval("this.tr('" + title + "');"), icon);

but it's using eval(), though it let me generate the source. 

I am using variables, because I create various widgets with identical title,
therefore I declared them inside statics members and read it from there.
Is there any chance to pass the string into tr() method someway,  or better
workaround than eval()?

Thanks in advance, Luke


Alexander Steitz wrote:
> 
> Hi Luke,
> 
> On Monday 07 December 2009 lp1051 wrote:
>> I just started to learn qooxdoo, and I like it a lot! 
> Thanks for the kudos and welcome to the project!
> 
>> Everything works fine so far, but now I came to problem with this.tr(). 
>> Snippet of code:
>> var title = "Title";
>> var icon = "path_to_icon";
>> var atom = new qx.ui.basic.Atom(this.tr(title), icon);
>> 
>> When I try to generate source (or even source-all) I get always following
>> error:
>>   - Processing translation for 2 locales...
>> !!! Could not extract translation from backoffice.fw.baseui.Desktop!
>> !!! Unsupported param of type variable at line 145
>> 
>> I have qooxdoo-0.8.3-sdk. When I do the same, but using this.tr("Title");
>> the compilation completes successfully. Why can't I pass variable (which
>> is
>> type of string) into tr() method? Any help appreciated.
> The translations methods ("tr" is one of them) are added to
> "qx.core.Object" 
> so every qooxdoo object instance has these methods.
> Static classes however do not get them as they are no instances of 
> "qx.core.Object". You have to use the "tr" method of "qx.locale.Manager"
> if 
> you want to use translation methods within static classes.
> 
> --snip-
> var i18nString = qx.locale.Manager.tr("title");
> --snip--
> 
> -> http://demo.qooxdoo.org/current/apiviewer/#qx.locale.Manager 
> 
> cheers,
>   Alex
> 
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://old.nabble.com/static-method-tr%28%29-not-working-with-variables---tp26674352p26674871.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to