[CLOSED] Localisation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Localisation

    I'm just starting a new app where the user can choose between many language after some search i find many ways to use localisation in asp.net
    for the asp pages :fieldlabel,text etc ......
    i found 2 ways neither using a global resource or a local resource

    using a global resource file in an explicit way

              <ext:Cell CellCls="styleOfCells">
                                    <ext:ComboBox LabelWidth="60" ID="comboGallery" runat="server" StoreID="dsGallery"
                                        LabelSeparator=" " LabelAlign="Right" Width="200px" Editable="false"
                                        DisplayField="getName" AllowBlank="false" ValueField="getId"  
                                        EmptyText="Select a Gallery..." AutoRender="false"   FieldLabel="<%$Resources:Localisation.aspx,test1%>">
                                      
                                    </ext:ComboBox>
    using a local resource file in an implicit way

           <ext:Cell CellCls="styleOfCells">
                                    <ext:ComboBox LabelWidth="60" ID="comboType" runat="server" StoreID="dsType"
                                        LabelSeparator=" " LabelAlign="Right" Width="200px" Editable="false"
                                        DisplayField="getName" FieldLabel="Type*" AllowBlank="false" ValueField="getId"
                                        EmptyText="Select an Employee..." AutoRender="false" 
                                        ContentUpdated="false" HiddenName="comboType_Value" 
                                        meta:resourcekey="comboTypeResource1" TriggerAction="All">
                                        <Template EnableViewState="false" Visible="false">
                                        </Template>
                                    </ext:ComboBox>
                                </ext:Cell>
    i just want to know if using one of this methods has any impact if used with ext.net controls ??and if i can use the asp:ScriptManager instead of the ext:ResourceManager for Localizing client side JavaScript is there any impact?? or is there any way to set up the ResourceManager to enable script localisation ????


     <asp:ScriptManager ID="ScriptManager1" EnableScriptLocalization="true" runat="server">
            <Scripts>
                  <asp:ScriptReference Path="../../Scripts/AllItemJS.js" ResourceUICultures="it-IT,fr-FR"  />
            </Scripts>
            </asp:ScriptManager>
    Last edited by Daniil; Aug 30, 2012 at 11:00 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Quote Originally Posted by FpNetWorth View Post
    i just want to know if using one of this methods has any impact if used with ext.net controls ?
    They both work well with Ext.NET controls.

    Quote Originally Posted by FpNetWorth View Post
    and if i can use the asp:ScriptManager instead of the ext:ResourceManager for Localizing client side JavaScript is there any impact??
    I think you can use ScriptManager to attach localized scripts. Though, if it will be a single purpose of ScriptManager on the page, I would remove it and use ResourceManager.

    Quote Originally Posted by FpNetWorth View Post
    or is there any way to set up the ResourceManager to enable script localisation ????
    You can register any script using:
    ResourceManager.GetInstance().RegisterClientScriptInclude("some resource key", "some resource URL");
    Also you can be interested to read these discussions related to localization.
    http://forums.ext.net/showthread.php?10391
    http://forums.ext.net/showthread.php?11194
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,


    You can register any script using:
    ResourceManager.GetInstance().RegisterClientScriptInclude("some resource key", "some resource URL");
    Please can you give me an example of using ResourceManager.GetInstance().RegisterClientScript Include
    should i include them in the page load and how the ResourceManager is going to identify the ResourceUICultures?? sorry but i couldn't find a lot of threads about this issue
  4. #4
    I mean something like this.

    Example
    <%@ Page Language="C#" UICulture="en-US" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                string scriptUrl = string.Format("resources/js/Test-{0}.js", System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
    
                this.ResourceManager1.RegisterClientScriptInclude("myScript", scriptUrl);
            }
        }
    </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 runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Button runat="server" Text="Click me">
                <Listeners>
                    <Click Fn="onClick" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
    The scripts names are "Test-en-US.js", "Test-ru-RU.js", etc.
  5. #5
    Thanks Daniil
    it works now with the ResourceManager

Similar Threads

  1. [CLOSED] Localisation - DatePicker in Italian
    By Justin_Wignall in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Jun 23, 2009, 12:09 PM

Tags for this Thread

Posting Permissions