I used the following code to handle localization in english and arabic applications, it is working
Protected Sub Page_PreInit( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.PreInit
Dim chooselang As String
chooselang = Request("CultureChoice")
If Trim(chooselang) <> "" Then
Application("CultureChoice") = chooselang
Else
chooselang = Application("CultureChoice")
If Trim(chooselang) = "" Then
chooselang = "en-US"
End If
End If
Dim lang As System.Globalization.CultureInfo
If chooselang = "ar-KW" Then
MasterPageFile = "MasterPageA.master"
Else
MasterPageFile = "MasterPage.master"
End If
lang = New System.Globalization.CultureInfo(chooselang)
System.Threading.Thread.CurrentThread.CurrentUICul ture = lang
End Sub
Where one of the Master Pages will Contain the english menu and the other will contain french menu
while the following should be contained in the culturechooser.aspx.
vb
Imports System.Data
Imports System.Globalization
Partial Class culturechooser
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim culture As CultureInfo
Dim str As String
str = Request.QueryString("CultureChoice")
culture = CultureInfo.CreateSpecificCulture(str)
Dim cookie As HttpCookie
cookie = New HttpCookie("CulturePref", culture.Name)
cookie.Expires = DateTime.Now.AddYears(100)
Response.Cookies.Add(cookie)
Dim chooselang As String
chooselang = Trim(Application("CultureChoice"))
If chooselang = "ar-KW" Then
chooselang = "en-US"
Else
chooselang = "ar-KW"
End If
End Sub
End Class
have a nice day