Hi,
I'm able to change the language for my pages, however if I select french and I am on a current page and if I try to load another page, that page won't be in french. How can I set it so it is consistent throught?
Toggle Button in master page:
If Page.Culture = "English (United States)" Then
Response.Redirect(Request.Url.AbsolutePath + "?lang=fr-CA")
ElseIf Page.Culture = "French (Canada)" Then
Response.Redirect(Request.Url.AbsolutePath + "?lang=en-US")
End If
and in every page:
Protected Overrides Sub InitializeCulture() Dim lang As String = String.Empty
lang = Request.QueryString("lang")
If lang IsNot Nothing Then
Session("culture") = lang
Thread.CurrentThread.CurrentCulture = New CultureInfo(lang)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang)
Else
If Session("culture") IsNot Nothing Then
lang = Session("culture").ToString()
Thread.CurrentThread.CurrentCulture = New CultureInfo(lang)
Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang)
End If
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US")
End If
MyBase.InitializeCulture()
End Sub