-
17 Jan 2013 11:33 PM #1
How to set the calculated title of a panel?
How to set the calculated title of a panel?
Hi,
I would like to set the title of a panel to a result of a method call.
Right now I have:
I would like to use the following code to set the title:Code:title: 'Rulesets'
Is that possible in Sencha Architect? Are there other tips for internationalization?Code:title: i18n.get('title.Rulesets')
Thanks,
Jan
-
18 Jan 2013 3:52 AM #2
Check out this link. Might help you understand localization. Another approach, here. And another one, here, written by one of the sencha developers.
Keep in mind, all of your components expose events. Consider a panel with several labels on it. When the panel initializes, you have the opportunity to set the labels value at that time.
Hope that helps get you started,
John
-
18 Jan 2013 7:07 AM #3
Thanks, but not working in Architect
Thanks, but not working in Architect
Thanks for your reply. But neither of these approaches can be used with Sencha Architect. Both approches require the title to be declared as JavaScript code. So either it would have to be:
Yet if I enter that in Architect I get:Code:title: i10n.translate("checkin.error.nickname", 3, 25) // 1st way title: Messages.CHECKIN_ERROR // 2nd way
That's exactly my problem. Architect escapes everything as String. Otherwise I would not have posted this.Code:title: 'i10n.translate("checkin.error.nickname", 3, 25)' // 1st way title: "Messages.CHECKIN_ERROR" // 2nd way
-
18 Jan 2013 7:12 AM #4
again, in the init event of your parent container or anywhere else in the code that fires prior to showing your labels do something like this:
this.down('#MyLabelsItemID').setValue('my value');
or
this.down('#MyLabelsItemID').setValue(i10n.translate("checkin.error.nickname", 3, 25));


Reply With Quote