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

      0  

    Default


    When I use the Ux.locale.Manager with datepickerfield it doesn't show up and raises an error on the first click. On the second click everything works, the months are translated.

    Here is the code:
    Code:
    Ext.define("USIMobile.view.SearchSportActivity", {
        extend: 'Ext.form.Panel',
        xtype: 'searchsportactivityform',
        fullscreen: true,
        
        requires: [
            'Ext.TitleBar',
            'Ext.form.FieldSet',
            'Ext.field.Text',
            'Ext.field.Select',
            'Ext.picker.Date',
            'Ext.field.DatePicker',
        ],
    
    
        config: {
            id: 'searchsportactivityform',
            items: [
                {
                    xtype: 'fieldset',
                    items: [
                        {
                            xtype: 'textfield',    
                            name: 'name',
                            locales: {
                                label: 'label.name'
                            }
                        },
                        {
                            xtype: 'selectfield',
                            name: 'category',
                            locales: {
                                label: 'SelectFieldCategory.label',
                                options: 'SelectFieldCategory.options'
                            },
                            usePicker: false,
                            
                        },
                        {
                            xtype: 'datepickerfield',    
                            name: 'from',
                            locales: {
                                label: 'label.from',
                            },
                            dateFormat: 'd M Y',
                            picker : {
                                enableLocale : true,
                                locales      : {
                                    months : 'months'
                                },
                                yearFrom: 2013,
                            },
                        },
                        {
                            xtype: 'datepickerfield',    
                            name: 'to',
                            locales: {
                                label: 'label.to',
                            },
                            dateFormat: 'd M Y',
                            picker : {
                                enableLocale : true,
                                locales      : {
                                    months : 'months'
                                },
                                yearFrom: 2013,
                            },
                        },
                        {
                            xtype: 'button',
                            locales: {
                                text: 'button.search',
                            },
                            ui: 'confirm',
                            action: 'search',    
                        }
    
    
                    ]
                }
            ]
        },
    }
    This is the error:
    Code:
    Uncaught TypeError: Cannot set property 'innerHTML' of undefined Container.js:191
    Ext.define.updateListItem Container.js:191
    Ext.define.onStoreUpdate DataView.js:1030
    Ext.define.doFire Controller.js:199
    Ext.define.fire Controller.js:126
    Ext.define.doDispatchEvent Dispatcher.js:347
    Ext.define.dispatchEvent Dispatcher.js:328
    Ext.define.doFireEvent Observable.js:256
    Ext.define.fireEvent Observable.js:214
    Ext.define.afterEdit Store.js:1348
    Ext.define.notifyStores Model.js:1161
    Ext.define.afterEdit Model.js:1123
    Ext.define.set Model.js:821
    (anonymous function) Date.js:26
    Ext.define.each Collection.js:523
    Ext.define.each Store.js:1244
    Ext.define.setLocale Date.js:24
    Ext.define.getPicker DatePicker.js:11
    Ext.define.onFocus DatePicker.js:357
    Ext.define.onMaskTap DatePicker.js:297
    Ext.define.doFire Controller.js:199
    Ext.define.fire Controller.js:126
    Ext.define.doDispatchEvent Dispatcher.js:347
    Ext.define.dispatchEvent Dispatcher.js:328
    Ext.define.doFireEvent Observable.js:256
    Ext.define.fireAction Observable.js:245
    Ext.define.onMaskTap Input.js:613
    Ext.define.doFire Controller.js:199
    Ext.define.fire Controller.js:126
    Ext.define.doDispatchEvent Dispatcher.js:347
    Ext.define.dispatch Publisher.js:65
    Base.implement.callParent sencha-touch.js:4616
    Ext.define.dispatch Dom.js:252
    Ext.define.doPublish Dom.js:294
    Ext.define.publish Dom.js:259
    Base.implement.callParent sencha-touch.js:4616
    Ext.define.publish TouchGesture.js:225
    Ext.define.onRecognized TouchGesture.js:209
    Ext.define.fire Recognizer.js:58
    Ext.define.onTouchEnd Tap.js:60
    Ext.define.invokeRecognizers TouchGesture.js:275
    Ext.define.onTouchEnd TouchGesture.js:426
    override.processEvent TouchGesture.js:498
    Ext.define.onEvent TouchGesture.js:102
    Base.implement.callOverridden sencha-touch.js:4734
    override.onEvent TouchGesture.js:494
    (anonymous function) sencha-touch.js:3182
    Any help? Please let me know if you need more info.

  2. #52
    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


    This is a known issue: https://github.com/mitchellsimoens/U...ager/issues/19

    I fixed that and Mitchell merged it today, so the issue could be closed.

    Also I extended the translation options of the datepickerfield. Now you can set the slotorder and the slot titles: https://github.com/Odi55555/Ux.local...f0c8fc8f5322cf

  3. #53
    Ext JS Premium Member
    Join Date
    Jan 2011
    Location
    NORWAY
    Posts
    106
    Vote Rating
    0
    frankbolviken is an unknown quantity at this point

      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?
    Did you figure this one out? I created a issue on the Github page, which describes this exact issue.
    When using navigation view and adding containers with title, it works when you hardcode it, but not when using locales.

  4. #54
    Sencha User Diego Garcia's Avatar
    Join Date
    Jan 2012
    Location
    San José, Costa Rica.
    Posts
    85
    Vote Rating
    7
    Diego Garcia is on a distinguished road

      0  

    Default


    I've been using this plugin for a while and I think it's worth to say it's great!
    Great great work @mitchellsimoens!!

    I just wanted to say thanks!!
    We are a community, let's behave like that.

  5. #55
    Sencha User
    Join Date
    Nov 2008
    Posts
    92
    Vote Rating
    1
    diablo is on a distinguished road

      0  

    Default s

    s


    i subscribe, nice job with the locale manager.
    one thing though, is it possible to apply it also to a selectfield?

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


    Quote Originally Posted by diablo View Post
    one thing though, is it possible to apply it also to a selectfield?
    There was the same question some posts earlier and Mitchell replied:

    Quote Originally Posted by mitchellsimoens View Post
    The values in the selectfield are not handled as if you are using a store then it will display what the server returned.
    I don't use a store for my selectfields, thats why I use this override. Not sure if this is perfect, but it works for me ;-)

    Code:
    Ext.define('Ux.locale.override.st.field.Selectfield', {
        override: 'Ext.field.Select',
    
        requires: [
        'Ux.locale.Manager'
        ],
        setLocale: function(locale) {
            var me = this,
                manager = me.locale,
                options = [],
                text = '',
                defaultText = '';
    
            me.callParent(arguments);
    
            if(me.config.options && me.config.options[0].locales) {
                options = me.config.options;
                for(var i = 0; i < options.length; i++) {
                    text = options[i].locales.text;
                    if(text) {
                        text = manager.get(text, defaultText);
                        if(Ext.isString(text)) {
                            options[i].text = text;
                        }
                    }
                }
                me.updateOptions(options);
            }
        }
    });
    That's how it works for me:

    Code:
                {
                    xtype: 'selectfield',
                    locales: {
                        label: 'fields.respond'
                    },
                    options: [{
                        locales: {
                            text: 'fields.yes'
                        },
                        value: 'J'
                    }, {
                        locales: {
                            text: 'fields.no'
                        },
                        value: 'N'
                    }]
                }

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

      0  

    Default Ux.locale.Manager for production

    Ux.locale.Manager for production


    I have changed the Ux.locale.Manager to Ext.locale.Manager and copied all the content to touch/src/locale directory.

    It works very well when I use the development microloader. But I'm not able to generate the production build.

    The sencha app refresh command fails when processing Ext.locale.Manager class.

    Here is the log. Please help me.

    Code:
     /s/h/t/www git:master ❯❯❯ sencha app refresh                                                                                         Sencha Cmd v4.0.1.45
    [INF] 
    [INF] init-plugin:
    [INF] 
    [INF] cmd-root-plugin.init-properties:
    [INF] 
    [INF] init-properties:
    [INF] 
    [INF] init-sencha-command:
    [INF] 
    [INF] init:
    [INF] 
    [INF] app-refresh:
    [INF]      [echo] Refreshing app at /home/apache/http/tiunesco/www
    [INF] 
    [INF] app-refresh-impl:
    [INF] 
    [INF] -before-init-local:
    [INF] 
    [INF] -init-local:
    [INF] 
    [INF] -after-init-local:
    [INF] 
    [INF] init-local:
    [INF] 
    [INF] find-cmd-in-path:
    [INF] 
    [INF] find-cmd-in-environment:
    [INF] 
    [INF] find-cmd-in-shell:
    [INF] 
    [INF] init-cmd:
    [INF]      [echo] Using Sencha Cmd from /opt/Sencha/Cmd/4.0.1.45 for /home/apache/http/tiunesco/www/build.xml
    [INF] 
    [INF] -before-init:
    [INF] 
    [INF] -init:
    [INF] Initializing Sencha Cmd ant environment
    [INF] Adding antlib taskdef for com/sencha/command/compass/ant/antlib.xml
    [INF] 
    [INF] -after-init:
    [INF] 
    [INF] -before-init-defaults:
    [INF] 
    [INF] -init-defaults:
    [INF] 
    [INF] -after-init-defaults:
    [INF] 
    [INF] -init-compiler:
    [INF] 
    [INF] init:
    [INF] 
    [INF] refresh:
    [INF] 
    [INF] -before-refresh:
    [INF] 
    [INF] -init:
    [INF] 
    [INF] -init-compiler:
    [INF] 
    [INF] -detect-app-build-properties:
    [INF] Loading app json manifest...
    [INF] Loading classpath entry /home/apache/http/tiunesco/www/touch/src
    [INF] Loading classpath entry /home/apache/http/tiunesco/www/app.js
    [INF] Loading classpath entry /home/apache/http/tiunesco/www/app
    [INF] Loading classpath entry /home/apache/http/tiunesco/www/build/temp/production/TiUNESCO/sencha-compiler/app
    [WRN] C1000: Rhino Parse Warning (Trailing comma is not legal in an ECMA-262 object initializer =>                 },) -- /home/apache/http/tiunesco/www/app/view/PicView.js:22:5
    [ERR] C2008: Requirement had no matching files (Ext.locale.Manager) -- /home/apache/http/tiunesco/www/app.js:33:222
    [ERR] 
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.ExBuild: Failed to find any files for /home/apache/http/tiunesco/www/app.js::ClassRequire::Ext.locale.Manager
    [ERR] 
    [ERR] Total time: 3 seconds
    [ERR] The following error occurred while executing this line:
    /opt/Sencha/Cmd/4.0.1.45/plugins/touch/2.3/plugin.xml:326: The following error occurred while executing this line:
    /home/apache/http/tiunesco/www/.sencha/app/build-impl.xml:367: The following error occurred while executing this line:
    /home/apache/http/tiunesco/www/.sencha/app/js-impl.xml:11: com.sencha.exceptions.ExBuild: Failed to find any files for /home/apache/http/tiunesco/www/app.js::ClassRequire::Ext.locale.Manager
    /s/h/t/www git:master ❯❯❯
    Last edited by arael78; 15 Jan 2014 at 8:13 AM. Reason: spelling

  8. #58
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Vote Rating
    817
    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


    First, why did you rename it? Please do not rename my code.
    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. #59
    Sencha User
    Join Date
    Aug 2012
    Posts
    56
    Vote Rating
    1
    arael78 is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    First, why did you rename it? Please do not rename my code.
    Sorry, I did it only because I thought this would allow me to create a production build. That is the only reason. I thought that putting the code in the touch/src folder would make it available to the sencha command.

  10. #60
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Vote Rating
    817
    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 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.
    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.