Hybrid View

  1. #1
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    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 Ux.locale.Manager

    Ux.locale.Manager


    Need to handle dynamic locale? Want to load locale via Ajax? Want locale to be applied without rerendering components? If so, Ux.locale.Manager may suit your needs.

    This manager does not support all components but examples have been provided to support other subclasses of Ext.Component (Sencha Touch or custom component).

    This manager also works with Ext JS 4, one class to rule them all!

    Sencha Market Listing: http://market.sencha.com/addon/ux.locale.manager
    GitHub repo: https://github.com/mitchellsimoens/Ux.locale.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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    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


    I will be supporting JsonP in the next release.

    This does not use bundles, no need for them really.
    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.

  3. #3
    Sencha User semiaddict's Avatar
    Join Date
    Mar 2010
    Posts
    45
    Vote Rating
    2
    semiaddict is on a distinguished road

      0  

    Default


    Thank you mitchellsimoens; exactly what I was looking for !
    ---
    Oussama Mubarak // Semiaddict

  4. #4
    Sencha User semiaddict's Avatar
    Join Date
    Mar 2010
    Posts
    45
    Vote Rating
    2
    semiaddict is on a distinguished road

      0  

    Default


    I've slightly modified Ux.locale.override.st.Container to allow specifying a title on a non tabbed container.

    The patch is attached.
    I've also submitted a pull request on GitHub.
    Attached Files
    ---
    Oussama Mubarak // Semiaddict

  5. #5
    Sencha User semiaddict's Avatar
    Join Date
    Mar 2010
    Posts
    45
    Vote Rating
    2
    semiaddict is on a distinguished road

      0  

    Default


    @mitchellsimoens,

    Any ideas on how to get this working for an Ext.MessageBox ?
    Since they are created on the fly, the setLocale function isn't called by the manager.

    Thank you.
    ---
    Oussama Mubarak // Semiaddict

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    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


    The buttons are already created and MessageBox should be picked up if you put a setLocale method so you would have to dig down to the buttons to change them.
    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. #7
    Sencha User
    Join Date
    Feb 2014
    Location
    Madrid, Spain
    Posts
    13
    Vote Rating
    0
    egomezd is on a distinguished road

      0  

    Default


    Hi,I´m new on Sencha, in fact I am finishing my first app. I have a couple of selectfields that the do not use datastorage and I would like to use Ux.locale.Manager to change the options value depending on the language selected by the user. Also I need to change the texts in doneButton and cancelButton. I´ve tried with the code provided by @armode for changing the text field in the options but no texts are shown by my selectfields.Help would be very appreciated. Thanks in advance.

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

      1  

    Default


    You have to override the selectfield to to change the options value. I guess that the selectfield is using a store even if you set static data. So you would have to update the store's data or update your options.

    Which code did you try to use to translate the buttons?
    The selectfield is using Ext.picker.Picker and the buttons belong to that class. Have a look at this override: https://github.com/mitchellsimoens/U...cker/Picker.js

  9. #9
    Sencha User
    Join Date
    Feb 2014
    Location
    Madrid, Spain
    Posts
    13
    Vote Rating
    0
    egomezd is on a distinguished road

      0  

    Default


    Thank so much for your help @armode.I´ve resolved the problem with the literals in done and cancel button reviewing the link you sent.Regarding the options in the selecfield, my level in Sencha is not enough good yet to override the selectfield class on my own but, following your advice, I´ve used a store to save the data. I´ve written the data in each language.json file and I recover the data using a proxy in the store in this way:
    Code:
    config: {            	      	autoLoad: true,    	model: 'Unit',    	storeId: 'UnitsStore',    	proxy: {	        type: "ajax",        	url : 'locales/en.json',        	reader: {            	type: "json",            	rootProperty: "options"        	}   }
    In the initialize function, I find out the language I have to use in the proxy url:
    Code:
    initialize: function() {    	var mystore = Ext.data.StoreManager.lookup ('UnitsStore');        var language = Ux.locale.Manager.getLanguage();    	var myurl = "locales/" + language + '.json';           	    	mystore.getProxy().setUrl(myurl);    	mystore.load();    } //end function initialize
    I don´t know if it´s a good solution but it´s working.