Hi,
This extension works with microloader in ST 2 (2.0 or 2.1) ?
Thanks
Hi,
This extension works with microloader in ST 2 (2.0 or 2.1) ?
Thanks
Works in my tests
Mitchell Simoens @LikelyMitch
Modus Create, Senior Frontend Engineer
________________
Need any sort of Ext JS help? Modus Create is here to help!
Check out my GitHub:
https://github.com/mitchellsimoens
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!
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 @LikelyMitch
Modus Create, Senior Frontend Engineer
________________
Need any sort of Ext JS help? Modus Create is here to help!
Check out my GitHub:
https://github.com/mitchellsimoens
Thank you for your hint.
It works!![]()
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'} ] } });
Any idea for previous post ?
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('') }
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' } } });
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?