Today I want to share how I localized my Windows Store application, very easy! Localization can also be implemented using “Resources File (.resw)” files. I will try it soon but first I wanted to implement a solution using my already existing resx files.
To test the developing process for Windows Store and Windows Phone I am using this project structure:
All localization terms are already in a portable class library, so that they are share between the Windows Phone and Windows 8 applications.
The terms are contained in “resx” files:
- AppResources.resx (default app language, English)
- AppResources.es-ES.resx (Spanish)
- AppResources.fra.FR.resx (French)
These files contains a list of string properties that we can create be created easily using the editor:
Once the project is compiled a class “AppResources” with a property of type string with each entrance of the table is created. The value of the string is resolved using the resx corresponding to the current language of the UI Thread.
There are several ways to use this resources files in XAML, I wanted to use them with the support of IntelliSense, with my solution it is possible to define a common Localization Provider on my App.xaml that uses the resources files contained by the portable class library: Continue reading