Hello,
I'm still trying to setup my multilinguage display in my webform and after having solved my problem of resource file compilation I'm expreriencing a new problem :
I created two resource files : one is named "strings.fr-FR.resx" for french culture and the other is named "strings.en-US.resx" for english culture. I put in the two files differente labels in french and english and I initialised my webform with the code below :
Public rm As ResourceManager
Public ciFR As New CultureInfo("fr-FR")
Public ciEN As New CultureInfo("en-US")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Session("language") = "English" Then
Thread.CurrentThread.CurrentCulture = ciEN
Else
Thread.CurrentThread.CurrentCulture = ciFR
End If
rm = New ResourceManager("Auditeurs_user.strings", Me.GetType.Assembly.GetExecutingAssembly)
If Not Page.IsPostBack Then
initpage()
End If
End Sub
My problem is that anything I do, it's always the french culture which is chosen and my web page always displays the same french labels.
If someone has an idea about how to switch from one culture to another.
PS : the Session("language") = "English" is initialized when I click on an English flag button and the string value "English" is saved in a session varaible.
Merci Beaucoup !!!
I'm still trying to setup my multilinguage display in my webform and after having solved my problem of resource file compilation I'm expreriencing a new problem :
I created two resource files : one is named "strings.fr-FR.resx" for french culture and the other is named "strings.en-US.resx" for english culture. I put in the two files differente labels in french and english and I initialised my webform with the code below :
Public rm As ResourceManager
Public ciFR As New CultureInfo("fr-FR")
Public ciEN As New CultureInfo("en-US")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Session("language") = "English" Then
Thread.CurrentThread.CurrentCulture = ciEN
Else
Thread.CurrentThread.CurrentCulture = ciFR
End If
rm = New ResourceManager("Auditeurs_user.strings", Me.GetType.Assembly.GetExecutingAssembly)
If Not Page.IsPostBack Then
initpage()
End If
End Sub
My problem is that anything I do, it's always the french culture which is chosen and my web page always displays the same french labels.
If someone has an idea about how to switch from one culture to another.
PS : the Session("language") = "English" is initialized when I click on an English flag button and the string value "English" is saved in a session varaible.
Merci Beaucoup !!!
Last edited: