Setting thread culture to default
In silverlight application I have MyTexts.resx (for english) and MyTexts.ja-JP.resx (for japanese) resource fi开发者_运维问答les. Before loading a page I can set current culture to japanese as following:
Thread.CurrentThread.CurrentCulture = new CultureInfo("ja-JP");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja-JP");
But sometimes I need to reset culture to default. How can I do that? The following wouldn't work:
Thread.CurrentThread.CurrentCulture = new CultureInfo("default");
OR
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
I myself seem to find an answer:
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
精彩评论