开发者

Who sets the thread culture in Windows Phone 7?

开发者 https://www.devze.com 2023-02-25 02:16 出处:网络
I want to internationalize my WP7 app.I have localized resources开发者_如何学Python, SupportedCultures tag etc.But I\'m wondering who is responsible for setting the Thread.CurrentThread.Current*Cultur

I want to internationalize my WP7 app. I have localized resources开发者_如何学Python, SupportedCultures tag etc. But I'm wondering who is responsible for setting the Thread.CurrentThread.Current*Culture? Is this set for me when the user changes their language on the device or do I have to detect the device language / region and set the thread culture accordingly?

Thanks!


You can use the CultureInfo.CurrentCulture property to determine the current region that has been set for the device. This is set by the framework; you do not have to set it yourself. If you need to change the locale for some reason, you can set the Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture properties.

You can test localized applications in the emulator by changing the region in the settings.

0

精彩评论

暂无评论...
验证码 换一张
取 消