Hi,

it seems to me that this is not a issue with setting the label to rich. 
The problem it the concatenation here an example:
var tmpString = "abc" + this.tr("Languages") + "def";

this.tr() return a LocalizedString [1] which can be translate at runtime 
and toString() returns the current translation. If you only do this:
var lbl_lang = new qx.ui.basic.Label(this.tr("Languages"));

The value can be translated on runtime, because the label listen to a 
change locale and call translate() on a localized string. But if 
'tmpString' is only a native String, the value couldn't be translated at 
runtime from the Label.

I think the only way is to handle the change locale your self:
qx.locale.Manager.getInstance().addListerner(" changeLocale", function(e) {
     var tmpString = "abc" + this.tr("Languages") + "def";
     lbl_lang.setValue(tmpString);
}, this);

Hope this helps.

Cheers,
Chris

[1] http://demo.qooxdoo.org/current/apiviewer/#qx.locale.LocalizedString

Am 22.12.2009 21:45, schrieb Simply Notes:
> Hi all, I run into a problem with translations.
>
> I use HTML format strings like "" from my own mixin to have a central place
> to change formats of labels. The code looks like
>
> var tmpString = snt.gui.fields.MSntFields.LBLRICHSTART +
> this.tr("Languages") + snt.gui.fields.MSntFields.LBLRICHEND;
>
> var lbl_lang = new qx.ui.basic.Label(tmpString);
> lbl_lang.setRich(true);
>
> when I change language in the application above label lbl_lang doesn't get
> translated.
> If I strip of the LBLRICHSTART and LBLRICHEND vars everything works fine. It
> also does when I include the HTML format codes in the this.tr(... ) String.
>
> Any ideas how I can use vars for the format strings and still get
> translation working?
>
> thanks in advance for your help
>    


-- 
Christian Schmidt
Software Entwickler

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
schmidt.christ...@1und1.de

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to