问题
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?
回答1:
This is definitely possible! See this list for cultures and their identifiers
So for example in the App.xaml.cs constructor you could access Thread.CurrentThread.CurrentCulture to determine the actual culture the app is running in. Now if you want to force the UI to use another culture you can do that by setting the CurrentUICulture. For example:
if (Thread.CurrentThread.CurrentCulture.Name.Equals("es-MX"))
{
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("es-ES");
}
来源:https://stackoverflow.com/questions/19098643/how-to-set-ui-language-in-code-for-windows-phone-application