When globalizing app, "Value does not fall within the expected range."

550 views Asked by At

I'm attempting to globalize my app, starting with Spanish. I've got the new resource file, AppResources.es-ES.resx, with my translated strings, and it seems to be working - almost.

My app successfully loads in Spanish (Spanish text and all) when I change the region and restart my phone (same with the emulator).

The problem occurs when I navigate to a page that contains a ListPicker, or any other control within the Windows Phone Toolkit. If any Toolkit controls are present on a page, and the Phone's (or Emulator's) region is set to Spanish (Spain/Espanol), an unhandled exception is thrown and the app crashes. The only details in the exception are:

Value does not fall within the expected range.

I did find this article (which appears to be on the right track), mentioned the Microsoft.Phone.Controls.Toolkit.resources.dll assembly not existing in the bin\cultureCode\ folder so I tried copying that assembly from the es-ES folder (packages\WPtoolkit.4.2013.08.16\lib\wp8\es-ES) into the debug\bin\es-ES\ folder of my app, and debugging that way, but still no luck. It seems like it could have something to do with that assembly.

Does anyone know what I need to do to use the Windows Phone Toolkit in combination with supporting other regions? I'm assuming that I'm missing some sort of setting but can't seem to find it.

More information:

In my Project Settings, I've got two Supported Cultures checked (English - United States, and Spanish - Spain). Then in my WMAppManifest.xml I've got Spanish (Spain) and English (United States) checked for Supported Languages.

2

There are 2 answers

0
lhan On BEST ANSWER

I found my problem, and am quite embarrassed. I found this article, which goes through a number of steps to globalize your app, and two things stuck out to me that I should double check:

  1. Make sure the Access Modifier is "Public" in my AppResources.es-ES.resx file. Check.
  2. Make sure the "ResourceLanguage" key has the correct value. Mine was half changed to "en-ES".

Hopefully this will help someone in the future.

Ensuring my ResourceLanguage key inside AppResources.es-ES.resx had the correct value of "es-ES" fixed my problem.