[CLOSED] Urgent: Ext.Net's support for localization and internationalization

Page 1 of 4 123 ... LastLast
  1. #1

    [CLOSED] Urgent: Ext.Net's support for localization and internationalization

    We recently introduced localization support for one of our large applications that uses Ext.Net in a major way. Introducing localization support for our application went well, and we added French as an option to application users.

    During testing, a strange exception with DateTimes was reported. After some analysis, I found that a particular operation in the application was executing well with the english language, but gave the exception in French.

    I was able to narrow down the problem with Ext.Net's DateField somewhere.
    When Freanch is set as the browser language, the DateField's DateMenu shows month names in French. But there are 2 important problems with the implementation:
    1) I selected 14 Nov, 2010 as the date, but it always automatically changes to 14 Feb 2010.
    2) Even then after submitting the date, it goes to the server as you can see in the screenshot below:

    Click image for larger version. 

Name:	Clipboard01.png 
Views:	199 
Size:	3.1 KB 
ID:	2282

    I was astonished that the value is transferred as the display text of the DateField, and not as sortable serialized representation (like it happens when sending dates from server to client for Stores).

    And still then, Ext.Net is not able to convert the value submitted on the server back to a valid date, and instead gives DateTime.MinValue as the value for the DateField.

    I have not checked elsewhere, but I suspect other widgets might also have such subtle problems.

    If it matters, our application always uses "en-US" as the current culture, only the UICultre is set to "fr" (or the user chosen language).

    To ensure that this is not causing any problem, I set both Thread.CurrentCulture and Thread.CurrentUICulture to "fr" but still the same exception.

    This is a blocking issue and has the capability to stall the entire localization feature we had introduced for our application :(
    Last edited by geoffrey.mcgill; Mar 01, 2011 at 3:38 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I cannot reproduce it.
    - I set French language in the Language preferences of IE
    - set Locale="client" in ResourceManager
    - run sample and ensure that french locale file is added
    - choose 14 Nov 2010 in DateMenu
    - click submit button

    Please provide additional instruction how we can reproduce the issue

    <%@ Page Language="C#" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    
    <script runat="server">
        protected void SubmitClick(object sender, DirectEventArgs e)
        {
            X.Msg.Notify("Selected date", DateField1.SelectedDate.ToLongDateString()).Show();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="client">           
            </ext:ResourceManager>
            
            <ext:DateField ID="DateField1" runat="server" />
            
            <ext:Button runat="server" Text="Submit">
                <DirectEvents>
                    <Click OnEvent="SubmitClick" />
                </DirectEvents>
            </ext:Button>   
            
        </form>
    </body>
    </html>
  3. #3
    I did a quick test with what you mentioned and it still fails for me. I will test this again more comprehensively tomorrow, but have you people made any fixes in this regard in the last couple of months or so??

    I thik our app is using Ext.Net from September or October.
  4. #4
    Hi,

    No, as I know we did not fix anything similar.
    Try to get latest Ext.Net and test my sample to ensure that the issue reproducible (or not reproducible) with latest code
  5. #5
    Hi vlad, sorry I could not reply to this thread earlier. Please check the attached 2 files. Set your Browser language to anything (English, French or whatever).

    Both these files demonstrate both of the issues I have mentioned in the first message above.

    As mentioned in the first message, the issue seems to occur because the toolkit transfers the display text of DateField to the server, instead of ISO serialized or some other standard form.

    I think sending serialized sortable format or UTC timestamp to the server and then using this on the server to parse it would take care of all locales.
    Attached Files
  6. #6
    Hi,

    Thanks for the samples. it is ExtJS french locale bug.
    French month names must be started with lower case letter, also short names (abbreviations) of some month must ended with '.'
    http://ucblibraries.colorado.edu/pre...reviations.pdf
    http://wordinfo.info/unit/3237/ip:23

    I fixed french locale files (you can update those files from SVN)
    http://svn.ext.net/premium/trunk/Ext...ext-lang-fr.js
    http://svn.ext.net/premium/trunk/Ext...-lang-fr-CA.js


    About second issue, ExtJS DateField submits own value as is (doesn't convert it to any unviresal format) therefore you have to set proper Culture on the server side to correct parsing. Please note that it must be Culture, not UICulture
    <%@ Page Language="C#" Culture="fr-FR" %>
    At this moment, setting culture is required and cannot be ommited. I will discuss it with Geoffrey today (converting submitting values to standard form)
  7. #7
    Quote Originally Posted by Vladimir View Post
    Hi,

    Thanks for the samples. it is ExtJS french locale bug.
    French month names must be started with lower case letter, also short names (abbreviations) of some month must ended with '.'
    I think it should be okay but still wanted to confirm if its safe to overwrite the French locale files from SVN in our version of Ext.Net and re-build.

    Quote Originally Posted by Vladimir View Post
    About second issue, ExtJS DateField submits own value as is (doesn't convert it to any unviresal format) therefore you have to set proper Culture on the server side to correct parsing.
    I think its Ext.Net which submits the value. ExtJs is purely client-side, its Ext.Net which extracts the value from ExtJs DateField, updates it to a Hidden field on the page which gets submitted. And ExtJs DateField returns a Date object when using getValue(), so Ext.Net can serialize it to any desired format before updating to hidden field.


    Quote Originally Posted by Vladimir View Post
    Please note that it must be Culture, not UICulture
    <%@ Page Language="C#" Culture="fr-FR" %>
    At this moment, setting culture is required and cannot be ommited. I will discuss it with Geoffrey today (converting submitting values to standard form)
    Culture is not an options for us. Things like Currency, Payments etc. need to be shown in a standard way to all the users, its only the front-end UI strings that need to be in the browser locale, so we need to set UICulture and not Culture.
  8. #8
    Hi,

    I think its Ext.Net which submits the value. ExtJs is purely client-side, its Ext.Net which extracts the value from ExtJs DateField, updates it to a Hidden field on the page which gets submitted. And ExtJs DateField returns a Date object when using getValue(), so Ext.Net can serialize it to any desired format before updating to hidden field.
    No, ExtJS field (atleast TextField inheritors) creates input field (where you input a text) and that field is submitted to server.
    Ext.Net doesn't extract and doesn't save any values to hidden fields because all submiting logic is contained inside each field, Ext.Net submits form only (submitting assumes retrieving data from native html inputs)


    Culture is not an options for us. Things like Currency, Payments etc. need to be shown in a standard way to all the users, its only the front-end UI strings that need to be in the browser locale, so we need to set UICulture and not Culture.
    You can create own DateField inheritor and override LoadPostData method (for example, you can replace CurrentCulture by CurrentUICulture)
  9. #9
    We are making some revisions to how the .Locale and Page level .CurrentUICulture properties are used.

    Revised code should be committed today.
    Geoffrey McGill
    Founder
  10. #10
    Thanks for the update Geoff, I will be looking forward to the changes.
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: Aug 06, 2012, 3:59 AM
  2. need urgent help challenging job
    By grajaneesh in forum 1.x Help
    Replies: 1
    Last Post: Apr 08, 2011, 2:31 PM
  3. [CLOSED] Message Box Localization support
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Apr 07, 2011, 8:17 PM
  4. [CLOSED] Help urgent with fileupload
    By smart+ in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 05, 2010, 12:13 PM

Posting Permissions