1. #41
    Sencha User
    Join Date
    Jul 2012
    Posts
    34
    Vote Rating
    -1
    urmilsetia is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by urmilsetia View Post
    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?
    Or should I, on application launch find the language using window.navigator.language and based on that decide the locale

  2. #42
    Sencha User armode's Avatar
    Join Date
    Nov 2011
    Location
    Germany / Darmstadt
    Posts
    64
    Vote Rating
    4
    armode is on a distinguished road

      0  

    Default


    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...

  3. #43
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    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
    ________________
    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.

  4. #44
    Sencha User
    Join Date
    Aug 2012
    Posts
    57
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    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")]}',
    	},
    });
    How do I fix the code to make it work with components not included in the Ux/locale/override/st directory?

    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.

  5. #45
    Sencha User
    Join Date
    Aug 2012
    Posts
    57
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    How do I set a locale for the Panel title?

  6. #46
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by arael78 View Post
    How do I set a locale for the Panel title?
    Sencha Touch Panels don't have a title.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  7. #47
    Sencha User
    Join Date
    Aug 2012
    Posts
    57
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    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:

    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
            }
    });
    This is the controller function that displays the view above:

    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()
                            });
                    }
            },
    So this doesn't work: this.getCourses().setTitle(Ux.locale.Manager.get('title.courses'));
    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

  8. #48
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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.

  9. #49
    Sencha User
    Join Date
    Aug 2012
    Posts
    57
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    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?

  10. #50
    Touch Premium Member
    Join Date
    Jan 2008
    Location
    Quebec, Canada
    Posts
    122
    Vote Rating
    1
    nbourdeau is on a distinguished road

      0  

    Default


    Quote Originally Posted by arael78 View Post
    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?
    Hi, same need here! Did you found out how to override to get this working ?
    @Mitchell can you provide some starting point on how to do this?

    thanks

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi