Hi,
I add Turkish,English and Greek languages to my masterpage in order to change labels on my web forms.But the problem is, i just want to change labels, button names, error messages NOT the dates etc. Here is what i changed;
masterpage.master
masterpage.master.vb
global.asax
contentpage.aspx
Also Content.resx , Content.en.resx and Content.el.resx files are generated in App_GlobalResources.
The code works but as i explained, when i changed to Turkish (native language), to English or Greek, labels change correctly but when i try to insert into DB, it gives error due to date!!! I just want to change labels etc., i dont want to change dates and numbers etc.
Any help would be great.
Thanks in advance.
Best Regards
I add Turkish,English and Greek languages to my masterpage in order to change labels on my web forms.But the problem is, i just want to change labels, button names, error messages NOT the dates etc. Here is what i changed;
masterpage.master
VB.NET:
<asp:DropDownList ID="ddlLanguage" runat="server" OnSelectedIndexChanged="ddlLanguage_SelectedIndexChanged"
AutoPostBack="true">
<asp:ListItem Text="Turkish" Value="tr-TR" />
<asp:ListItem Text="English" Value="en-US" />
<asp:ListItem Text="Greek" Value="el-GR" />
</asp:DropDownList>
masterpage.master.vb
VB.NET:
Protected Sub ddlLanguage_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
'Sets the cookie that is to be used by Global.asax
Dim cookie As HttpCookie = New HttpCookie("culture")
cookie.Value = ddlLanguage.SelectedValue
Response.Cookies.Add(Cookie)
'Set the culture and reload the page for immediate effect.
'Future effects are handled by Global.asax
Dim ci As New System.Globalization.CultureInfo(cookie.Value)
System.Threading.Thread.CurrentThread.CurrentCulture = ci
System.Threading.Thread.CurrentThread.CurrentUICulture = ci
Server.Transfer(Request.Path)
End Sub
global.asax
VB.NET:
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Dim cookie As HttpCookie
cookie = Request.Cookies.Get("culture")
If (Not cookie Is Nothing) Then
Dim ci As New System.Globalization.CultureInfo(cookie.Value)
System.Threading.Thread.CurrentThread.CurrentCulture = ci
System.Threading.Thread.CurrentThread.CurrentUICulture = ci
Else
Dim ci As New System.Globalization.CultureInfo("tr-TR")
System.Threading.Thread.CurrentThread.CurrentCulture = ci
System.Threading.Thread.CurrentThread.CurrentUICulture = ci
End If
End Sub
contentpage.aspx
VB.NET:
<asp:Label ID="Label7" runat="server" Text="<%$ Resources:Content, Label7 %>"></asp:Label>
Also Content.resx , Content.en.resx and Content.el.resx files are generated in App_GlobalResources.
The code works but as i explained, when i changed to Turkish (native language), to English or Greek, labels change correctly but when i try to insert into DB, it gives error due to date!!! I just want to change labels etc., i dont want to change dates and numbers etc.
Any help would be great.
Thanks in advance.
Best Regards