,

Localizability Using Resx Files

Windows Phone apps follow the same hub and spoke model for localization that .NET desktop CLR applications do. Satellite assemblies provide culture-specific resources, while a main assembly contains a default set of resources that are used to fall back on. This process of producing the main assembly and satellite assemblies is done automatically at build time.

At runtime, the CLR selects the appropriate composite set of resources to use. The culture settings of a Windows Phone app and the language displayed are dependent on the culture settings of the phone itself.

Resx files have been employed to localize .NET applications since .NET 2.0 and Windows Forms. Resx files support the production of what is known as localized satellite assemblies. These are assemblies that are discovered at runtime and contain culture-specific resources.

In Silverlight browser applications, and desktop CLR projects, a major benefit of satellite assemblies is that they can be used to reduce the overall package size of an application. By storing culturally specific resources separately from the main assembly, culturally specific resources can be downloaded on demand. For example, if an application supports 10 languages, and each set of localized strings and images is 1MB, you can reduce the overall download size by 9MB (10MB−1MB = 9MB). In some scenarios this can prove to be critical, such as in Silverlight browser applications, where the proper use of bandwidth can play a large factor in an application’s success. It is, however, largely irrelevant for Windows Phone apps, because the manner in which satellite assemblies are deployed to the phone, in particular the bundling of all assemblies into a single XAP file, including satellite assemblies, means that without the use of multiple resource projects, all satellite assemblies are deployed to the phone anyway; therefore, it does not reduce the overall footprint of an app. Moreover, the Windows Phone Marketplace requires each app to come complete with localized resources for all languages supported by the app. The topic of separate deployment of satellite assemblies, therefore, is not covered in this book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.101.178