Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m working with add_resources but not to trasfer all control to english to hindi......
i hve three lable one button and one dropdown list..
XML
<table>
            <tr>
                <td colspan="3">
                    <asp:Label ID="Label_main" runat="server" Font-Names="Verdana" Text="Select Language"
                        Width="138px" meta:resourcekey="Label_mainResource1"></asp:Label></td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="Label_lan" runat="server" Font-Names="Verdana" Text="Language" meta:resourcekey="Label_lanResource1"></asp:Label></td>
                <td colspan="2" style="width: 187px">
                    <asp:DropDownList ID="DropDownList_lang" runat="server" Width="131px"  AutoPostBack="True">
                    <asp:ListItem>Auto</asp:ListItem>
                    <asp:ListItem meta:resourcekey="ListItemResource1" Text="English" Value="en-US"></asp:ListItem>
                    <asp:ListItem meta:resourcekey="ListItemResource2" Text="Hindi" Value="hi-IN"></asp:ListItem>
                    <%--<asp:ListItem meta:resourcekey="ListItemResource3" Text="Gujarati" Value="gu-IN"></asp:ListItem>--%>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td style="width: 100px">
                </td>
                <td colspan="2" style="width: 187px">
                    <asp:Button ID="Button1" runat="server" meta:resourcekey="Button1Resource1" Text="Change Language" OnClick="Button1_Click" /></td>
            </tr>
        </table>

i have try code this
string culture = Request.Form["DropDownList_lang"];
        if (string.IsNullOrEmpty(culture))
            culture = "Auto";
        //Use this
        UICulture = culture;
        Culture = culture;
        //OR This
        if (culture != "Auto")
        {
            System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);
            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
        }

        base.InitializeCulture();

my problem i not change effect when change in language in dropdownlist box ,,,english to hindhi
i try to make debug poin and i will get result like culture ="HINDI-INDIA"
but.my browser side values not pass to english to hindi.
i have add hindi language on my browser ...but problem is still.
please anybody help me.
Posted
Updated 13-Dec-10 20:02pm
v3
Comments
Toniyo Jackson 14-Dec-10 2:02am    
Always put your code inside code block.

1 solution

Hi,

I realise the link I am about to place here is to a site in VB.NET. But if you follow it, it shows you how to do this.

http://vswdtutorialcorner.wordpress.com/2007/09/30/using-localization-in-the-masterpage-vb-sample/

The link goes through it step at a time. And I believe if you follow this, it should help you place a language choice on your site to allow you to select Hindi or English.

Good Luck

Rob
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900