VS Silverlight beta2 adjusted its build functionalities to support the new Silverlight runtime localization model, which essentially is โone language, one xapโ. This article provides the steps to take to build a localized app
Let us say, you want to localize your app for the culture of โja-jpโ. You have created several resource files and you want VS to pack the satellite assemblies into the .xap file.
1. In the solution explorer unload the Silverlight project and edit the project file. There is pre-created tag of โSupportedCulturesโ in the first property group tag. Fill in the culture value of โja-jpโ, so you get โ<SupportedCultures>ja-jp</SupportedCultures>โ. Note, you can also fill in a culture list separated by โ,โ or โ;โ to support multiple cultures/languages in the same xap file. For example you can fill in a string of โja-JP;fr-FRโ. VS reads this list and only packs related satellite assembly folders.
2. Save the project file, reload it and then build it. You can open the .xap file generated under โBinDebugโ to check out the content. You can see VS only packs the โja-jpโ folder, but no โjaโ folder since it is not in the culture list.
3. If you would like to create a new xap file for a new culture, say โdeโ, you need to create new build configuration in VS and insert the tag of โ<SupportedCultures>de</SupportedCultures>โ into the related property group tag in the project file
The project file change looks like,
4. If you have a hosting web project, you are recommended to turn on the โcopy to configuration specific foldersโ through the โSilverlight Applicationsโ tab in webโs property page dialog. Just click the โChangeโฆโ button. You can also enable it in the โAdd Silverlight Applicationโ wizard when you create a new project. So different .xap files will stay underneath a separate subfolder, and they wonโt overwrite each other.


0 comments