1. #1
    Sencha User murrah's Avatar
    Join Date
    Oct 2007
    Location
    Katoomba, Blue Mountains, west of Sydney, Australia
    Posts
    384
    Vote Rating
    11
    murrah will become famous soon enough

      0  

    Default Australian locale files for Ext3 & Ext4

    Australian locale files for Ext3 & Ext4


    After much mucking about with funny date validation, date field 'format' and 'altFormats' I finally realised that to make life easier I needed an Australian locale file! There wasn't one, but now there is!

    The main problem with using the default (US) locale file for Australia is that unless one specifies the long altFormats shown below on each date field, a date entered as (say) 2/3/12 (March 2nd) might be changed onBlur to 3/2/12 (Feb 3rd)!

    So....
    Attached is an edit of the en_GB file with extra altFormats:
    PHP Code:
    altFormats"d/m/Y|d/m/y|d-m-y|d-m-Y|d/n/Y|d/n/y|d-n-y|d-n-Y|d/m|d-m|dm|dmy|dmY|d|j/m|j-m|jm|jmy|jmY|j|Y-m-d|j/n/y|j/n/Y|j/m/y|j/m/Y|j-n-y|j-n-Y|j-m-y|j-m-Y" 
    to allow for any combination of leading zeroes or not and 2 or 4 digit years.

    The default date field format is:
    PHP Code:
    format"d/m/y" 
    so as long as that is the one you want (ie equivalent to "dd/mm/yy") you wont need to define a format or altFormat on your date fields. I find that I am tending to use "j/n/y" --> "d/m/yy" for data entry which you could set in the config of the locale file if you wish. See:
    PHP Code:
    Ext.define("Ext.locale.en_AU.form.field.Date"... 
    To use: for ExtJS 4.x:
    Unzip the attached Ext4 file into [your ext install folder]/locale/ext-lang-en_AU.js

    For ExtJS 3.x:
    Unzip the attached Ext3 file into [your ext install folder]/src/locale/ext-lang-en_AU.js
    (NOTE: I have NOT tested the Ext3 file yet)

    In your HTML include it after the "standard" ext includes and before your app code.

    Please let me know via this post if there are any problems.

    Thanks,
    Murray

    PS: I haven't looked at dynamic localisation yet. I think there are some posts on that but at least you will have a relevant file!

    PPS: It was very tempting to change the OK,Cancel,Yes,No buttons to Cheers mate, Bugger off, You ripper! and No way!... ;-)
    Attached Files

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,935
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for the contribution. I guess this means I need to make a 'texan' version

    Scott

  3. #3
    Sencha User murrah's Avatar
    Join Date
    Oct 2007
    Location
    Katoomba, Blue Mountains, west of Sydney, Australia
    Posts
    384
    Vote Rating
    11
    murrah will become famous soon enough

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Thank you for the contribution. I guess this means I need to make a 'texan' version

    Scott
    Maybe..... How would you code the dialogue box buttons??

Thread Participants: 1