-
19 Feb 2013 5:15 AM #41
-
19 Feb 2013 11:00 PM #42
I think this is all up to you.
In my case, there is a default language for the first launch, which is set in a server config file. After that the user is able to change the language in app settings and this is stored in HTML5 local storage.
But as I wrote, this is all up to you. Locale Manager just gives you the possibility to override almost all touch components and get a language file via ajax.
Have a look into the example on github; it's in the "st" folder...
-
20 Feb 2013 7:17 AM #43Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Just posting a link to a blog post that does a really good job at describing how to use this: http://www.swarmonline.com/2013/02/l...ocale-manager/
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
12 Mar 2013 8:00 AM #44
How do I fix the code to make it work with components not included in the Ux/locale/override/st directory?Code:Ext.define("USIMobile.view.Calendar", { extend: 'Ext.dataview.List', xtype: 'calendar', config: { id: 'calendar', locale: { title: 'title.calendar', }, emptyText: 'No info available.', itemTpl: '{[values.id != "academiccalendar" ? values.title : values.title + USIMobile.Session.getAcademicCalendarStore().first().get("year")]}', }, });
In this case I'm not able to set the title according to the lang.json definitions. Should I add Ux.local.override.st.DataView and Ux.local.override.st.List classes?
What would be the best approach to include the support for List component and for all other components I extend?
Thank you very much.
-
13 Mar 2013 5:53 AM #45
-
13 Mar 2013 5:58 AM #46Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Mar 2013 6:09 AM #47
You are right indeed.
But I don't understand. If I extend the Ext.form.Panel or Ext.dataview.List and set the title in the config object it is displayed correctly. I use Navigation view to navigate between various views. Where is then set the title and is there a way to use Ux.locale.Manager in this case?
Here is a the code:
This is the controller function that displays the view above:Code:Ext.define("USIMobile.view.Courses", { extend: 'Ext.dataview.List', xtype: 'courses', config: { id: 'courses', title: 'Courses', emptyText: 'No courses found.', itemTpl: '{title}', grouped: true } });
So this doesn't work: this.getCourses().setTitle(Ux.locale.Manager.get('title.courses'));Code:listCourses: function() { this.filterCoursesStore(); if(typeof this.getCourses() == 'object') { this.getCourses().refresh(); this.getCourses().setTitle(Ux.locale.Manager.get('title.courses')); this.getHome().push(this.getCourses()); } else { this.getHome().push({ xtype: 'courses', title: Ux.locale.Manager.get('title.courses'), store: USIMobile.Session.getCoursesStore() }); } },
because the Ext.dataview.List doesn't have setTitle.
But pushing the new object in the navigationview sets the title.Last edited by arael78; 13 Mar 2013 at 6:17 AM. Reason: more info
-
13 Mar 2013 6:10 AM #48Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
That's because the navigation view uses it (same for tab panel) but the panel, form panel, list, etc do not use it. So if you want the dynamic updating of titles in a navigation view you will have to work with both the panel and the navigation view.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Mar 2013 6:23 AM #49
So this means that I should overwrite the Ext.Navigation.view and get it to read the locales object from the panel or list that is visible?
-
14 Mar 2013 8:42 AM #50



Reply With Quote