Page 4 of 8 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 71

Thread: Ux.locale.Manager

  1. #31
    Sencha Premium User couetbis's Avatar
    Join Date
    Jan 2008
    Location
    Nantes - France
    Posts
    108
    Vote Rating
    1
      0  

    Default

    Hi,
    This extension works with microloader in ST 2 (2.0 or 2.1) ?
    Thanks

  2. #32
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,415
    Vote Rating
    1269
      0  

    Default

    Works in my tests
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #33
    Sencha User
    Join Date
    Dec 2012
    Location
    Augsburg, Germany
    Posts
    4
    Vote Rating
    0
      0  

    Default 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!

  4. #34
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,415
    Vote Rating
    1269
      1  

    Default

    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
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  5. #35
    Sencha User
    Join Date
    Dec 2012
    Location
    Augsburg, Germany
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Thank you for your hint.
    It works!

  6. #36
    Sencha Premium User couetbis's Avatar
    Join Date
    Jan 2008
    Location
    Nantes - France
    Posts
    108
    Vote Rating
    1
      0  

    Default

    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 :
    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'}
    		      ]
    	}
    });
    What must I do ?

  7. #37
    Sencha Premium User couetbis's Avatar
    Join Date
    Jan 2008
    Location
    Nantes - France
    Posts
    108
    Vote Rating
    1
      0  

    Default

    Any idea for previous post ?

  8. #38
    Sencha Premium User couetbis's Avatar
    Join Date
    Jan 2008
    Location
    Nantes - France
    Posts
    108
    Vote Rating
    1
      0  

    Default

    Another question : how can we do with templates ?

    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('')
    }
    This, returns "undefined"

  9. #39
    Sencha Premium User couetbis's Avatar
    Join Date
    Jan 2008
    Location
    Nantes - France
    Posts
    108
    Vote Rating
    1
      0  

    Default

    I found a solution for templates :
    Code:
    {
              xtype : 'dataview',
              store : 'ConversionsEquivalence',
              itemTpl : new Ext.XTemplate([
                  '<tpl for="conversionsSimples">',
                  ...            
                  '<div class="statf-title">{[this.getTraduction(\'labels.conversions_equivalence_statf_titre\')]}'
                      + '&nbsp;</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);
                  }
              }
    For data in store I do this :
    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'
    		}
    	}
    });

  10. #40
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    37
    Vote Rating
    -1
      0  

    Default

    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?

Page 4 of 8 FirstFirst ... 23456 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •