c# - asp.net CurrentUICulture and resx file -
in asp.net app want let user change profile language , load respective resx file.
i have 2 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(...)
used when user changes profile settings.
the problem is fallbacking localizedtext.resx
file instead of loading localizedtext.pl.resx
i debbuged , currentuiculture "en_us" @ beginning of page_load.
i tried set uiculture , culture properties didn't work.
when use page.culture="auto" loads .pl.resx file when set browser language "pl" not want.
any ideas? thanks
i think should override page initializeculture
method , set currentuiculture
there. more info see: http://msdn.microsoft.com/en-us/library/system.web.ui.page.initializeculture.aspx
Comments
Post a Comment