Can't get es-MX resource file to be used
I am working on a localized wp7 app and in the process of building my resx files and running into a issue where the es-MX file is not getting used when the phone is set correctly. I have a es-ES file also and the strings from it are being used instead of the es-MX file.
Here is the supported cultures from my csproj:
<SupportedCultures>en-GB;es开发者_如何学Python-PE;es-MX;it;fr;nl;es-ES;</SupportedCultures>
And when check the CurrentCulture for the thread it is returning es-MX. But the strings are being loaded from the es-ES file.
Thanks for any help.
Chris
After following the examples at: http://msdn.microsoft.com/en-us/library/ff637520%28v=vs.92%29.aspx this was still not working correctly. This came down to not getting differences between es-ES and es-PE not be picked up correctly.
Added this line of code to App() in App.XAML.cs brought it all together.
AppResources.Culture = System.Threading.Thread.CurrentThread.CurrentCulture;
The reason is that the es-MX Culture is not supported on the Windows Phone OS 7.0 or 7.1, but the es-ES Culture is, and that's why is using that instead.
For a complete list of supported cultures see this blog What languages and cultures are supported in WP7? or this link Culture and Language Support for Windows Phone
Regards,
Gerardo Melendrez
The Magic Software
精彩评论