Project Description
WPF Localization Support allows developpers to localize their WPF applications via markup extensions. It extends the code from WPF Tutorial so that you are not limited to dependency properties. It's developed in C#.

The library provides two markup extensions:
  • Localize that is designed to provide localized values to dependency properties
  • ReflectedLocalize that uses reflection in order to extend the localization capabilities to CLR properties

I made this library when I needed myself some kind of support for localization of my WPF application ideally with a possibility to change the languages during runtime without restarting it. I found this nice article on WPF tutorial where the author used a custom markup extension to accomplish the task. I downloaded his code and everything was perfectly fine until I needed to localize the textual descriptions of ribbon commands (I use the Ribbon CTP in my project). These commands are not dependency objects and so the approach taken on WPF tutorial did not work. But I didn't want to resign on the idea and so I finally extended the localize extension a bit. From the user's point of view not much has changed:

<TextBlock Text="{Localize Text}"/>
in comparison to
<SomeObject NonDepProp="{ReflectedLocalize Text,NonDepProp}"/>

As you can see the only difference in usage (apart from the extension name) is that a second parameter is needed that is the name of the property being set by the extension. As you guess, I use the reflection. I also slightly changed the implementation of the localization manager so that it could possibly use a different resource provider for each localization. For details, please, consult the Documentation.

Hopefully, this library will be useful for someone.

Last edited Jul 29, 2009 at 4:27 PM by Luk, version 5