' Fires when the application is started
Application("RM") =
ResourceManager.CreateFileBasedResourceManager("fp", _
Server.MapPath("resources") _
+ Path.DirectorySeparatorChar, _
Nothing)
End Sub
Sub Application_BeginRequest(ByVal sender As Object,
ByVal e As EventArgs)
' Fires at the beginning of each request
' For each request initialize the culture values with the
' user language as specified by the browser.
Try
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages
(0))
Catch
' provide fallback for not supported languages.
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-
US")
End Try
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture
Application("ci") =
Thread.CurrentThread.CurrentUICulture.Name
End Sub
-----
my webform1.asx code
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Response.Write("current culture info : " & Application
("ci"))
'Put user code to initialize the page here
Dim rm As ResourceManager
' Get the ResourceManager from the Application object.
rm = Application("RM")
TextBox1.Text = rm.GetString("Year",
Thread.CurrentThread.CurrentUICulture)
Label1.Text = rm.GetString("French",
Thread.CurrentThread.CurrentUICulture)
End Sub
--------
my output
current culture info : fr-FR
franais
anne
PLease note the missing french characters ...