-
15 Nov 2012 2:38 AM #31
Hi,
This extension works with microloader in ST 2 (2.0 or 2.1) ?
Thanks
-
18 Nov 2012 6:32 AM #32Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
Works in my tests
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 Dec 2012 4:40 AM #33
Default Language
Default Language
Hi!
I'm using the really great Ux.locale.Manager in my Sencha Touch 2.1 application. Now I'm wondering if it is possible to pass an default language to the Manager when the language has no available json-file.
Is it possible in the current Version of the locale.Manager or what can I do to pass an default language for my app?
Thank You!
-
13 Dec 2012 5:39 AM #34Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
You should keep a list of available locales and set one of them as the language if the language of the browser is not one of them.
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 Dec 2012 7:14 AM #35
Thank you for your hint.
It works!
-
2 Jan 2013 2:26 AM #36
Hi,
It's a good extension, thanks.
How can I use it to translate data in a store ?
With microloader, content is already loaded (so isn't available yet), my code :
What must I do ?Code:Ext.define('MyApp.store.Menus',{ extend: 'Ext.data.Store', config:{ model : 'MyApp.model.Menu', data: [ {'id':1,'titre':Ux.locale.Manager.get('labels.menustore_volumes'),'action':'volumes'}, {'id':2,'titre':Ux.locale.Manager.get('labels.menustore_conversions'),'action':'conversions'}, {'id':3,'titre':Ux.locale.Manager.get('labels.menustore_articles'),'action':'articles'}, {'id':4,'titre':Ux.locale.Manager.get('labels.menustore_publications'),'action':'publications'}, {'id':5,'titre':Ux.locale.Manager.get('labels.menustore_apropos'),'action':'apropos'} ] } });
-
28 Jan 2013 12:55 AM #37
Any idea for previous post ?
-
15 Feb 2013 2:54 AM #38
Another question : how can we do with templates ?
This, returns "undefined"Code:{ xtype : 'dataview', store : 'ConversionsEquivalence', itemTpl : [ '<div class="statm-title">' + Ux.locale.Manager.get('labels.conversions_equivalence_statm_titre')+'</div>', '<tpl for="statistiquesMondiales">', '<div class="statm"> ', ... ].join('') }
-
19 Feb 2013 12:06 AM #39
I found a solution for templates :
For data in store I do this :Code:{ xtype : 'dataview', store : 'ConversionsEquivalence', itemTpl : new Ext.XTemplate([ '<tpl for="conversionsSimples">', ... '<div class="statf-title">{[this.getTraduction(\'labels.conversions_equivalence_statf_titre\')]}' + ' </div><div class="statf-desc">{[this.getTraduction(\'labels.conversions_equivalence_statf_desc\')]}</div>', ... '</tpl>', '</div> ','</tpl>' ].join(''),{ getTraduction: function(cle){ return Ux.locale.Manager.get(cle); } }
Code:Ext.define('Cpdp.model.Menu', { extend: 'Ext.data.Model', config:{ fields: [ {name: "id", type: "int"}, {name: "codeTitre", type: "string"}, { name: 'titre', convert: function(value, record) { return Ux.locale.Manager.get(record.get('codeTitre')); } }, {name: "action", type: "string"} ] } }); Ext.define('Cpdp.store.Menus',{ extend: 'Ext.data.Store', config:{ model : 'Cpdp.model.Menu', autoLoad: false, proxy:{ type: 'ajax', url: 'locales/menu.json' } } });
-
19 Feb 2013 4:47 AM #40
Hi mitchellsimoens, Really nice extension.
I have just one question, I am making an app for iOS and Android now when user changes the locale of the iOS device(from settings), does it automatically get the locale from the OS or I have get it to sencha layer and update it?


Reply With Quote