1

Let's say my application doesn't support culture es-MX so when this is the current setting on the phone I'd like to set the culture to es-ES. Is this possible to do in Windows Phone and if so how?

4

1 回答 1

4

这绝对是可能的!有关文化及其标识符,请参阅此列表

因此,例如在 App.xaml.cs 构造函数中,您可以访问 Thread.CurrentThread.CurrentCulture 以确定应用程序正在运行的实际文化。现在,如果您想强制 UI 使用另一种文化,您可以通过设置 CurrentUICulture 来做到这一点. 例如:

if (Thread.CurrentThread.CurrentCulture.Name.Equals("es-MX"))
{
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-ES");
}
于 2013-09-30T16:34:22.950 回答