In my asp.net app I want to let user to change his profile language and then load respective resx file.
I have two global .resx files:
LocalizedText.resx
LocalizedText.pl.resx
protected void Page_Load(object sender, EventArgs e)
{
...
if (!IsPostBack)
{
setUserSettings(...)
}
}
and
private void setUserSettings(...)
{
...
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("pl");
}
setUserSettings(...)
is used also when user changes his profile settings.
The problem is that it is always fallbacking to LocalizedText.resx
file instead of loading LocalizedText.pl.resx
I debbuged it and CurrentUICulture is always "en_US" at the beginning of Page_Load.
I tried to set also UICulture and Culture properties but it didn't work.
When I use Page.Culture="auto" it loads .pl.resx file when I set my browser language to "pl" but it is not what I want.
Any Ideas? Thanks