1. #61
    Sencha User
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    You shouldn't touch the touch directory. Instead you should have the code somewhere else in you app and then edit the app.classpath property in the .sencha/app/sencha.cfg file. This is where it tells what directories to inspect.
    Ok. So I suppose this is the variable I should modify: app.resource.paths.

    What is the best practice. Should I put the Ux.locale.Manager code inside the package directory?

    EDIT: As a quick test I have set this: app.resource.paths=${app.dir}/touch/src/locale and the problem persists.

  2. #62
    Sencha User
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    The correct variable was: app.classpath just like you wrote.

    Sorry but it is 17:40 here and I'm quite tired so I overlooked it.

    Thank you very much for your help.

    I'll revert the change Ext.locale.Manager to Ux.locale.Manager as it was before.

    Is the package directory the appropriate place for your code?

  3. #63
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    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


    You can place the code wherever makes sense for you. The package directory is meant to be used for Cmd packages.
    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. #64
    Sencha User
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    Ok. Is there a packaged version of the locale manager?

    In the end I created a directory "extensions". It seems the most appropriate to me. Polluting the packages directory doesn't seem to be a good idea.

    Really, thank you for all the patience. =)

  5. #65
    Sencha Premium Member
    Join Date
    Dec 2013
    Posts
    24
    Vote Rating
    1
    bkhosravi is on a distinguished road

      0  

    Default


    This component does not exist on the market. is it still being worked on? is there an alternative?..I really like it as it is the only locale manager I have found so far for extjs.

    Thanks.

  6. #66
    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.

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

  8. #68
    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.

  9. #69
    Sencha User
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    28
    Vote Rating
    0
    shellgrit is on a distinguished road

      0  

    Default Ux.locale.Manager not available in Controller launch function

    Ux.locale.Manager not available in Controller launch function


    My app stores the users selected language (and other settings) in Local Storage and retrieves them via the launch function of my Settings Controller. Based on the language, it then sets the store to be used (ie. either the "English" or "Chinese" store).

    I have two problems:
    1. How do I retrieve the full name of a language from Ux.locale.Manager, as the getLanguage function only returns the abbreviation for the language (ie. "en" or "zh"), but I would like to get the full name (ie. "English" or "Chinese")? I need this so that I can set the store to either "English" or "Chinese" and remove the hard coding I have at the moment (and therefore be able to support additional languages without coding changes).
    2. I need to set the badgeText for a tab based on another setting retrieved from Local Storage and this text needs to be in the selected language. I have tried doing this via the get function, however it seems that Ux.locale.Manager isn't operational when my launch function runs, as the isLoaded function always returns false. When I use the get function to do the same thing outside my launch function it works fine and isLoaded returns true.
    Hope this makes sense

  10. #70
    Sencha User
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    28
    Vote Rating
    0
    shellgrit is on a distinguished road

      0  

    Default Using getAvailable to get the "full name" of a language

    Using getAvailable to get the "full name" of a language


    I have solved problem number 1 - how to get the "full name" of a language.

    The function getAvailable returns an array of objects, with each object containing "abbr" & "text" value pairs for each language. So I can search through the array until I find the matching "abbr" and retrieve the corresponding "text".

    Here is the code:

    Code:
    var languages = Ux.locale.Manager.getAvailable(true),
        l = 0,
        lNum = languages.length;
    for (; l <lNum; l++) {
        if (languages[l].abbr == value) {
            ... do whatever ... ;
            break;
        }
    };
    Hope this makes sense