This is a mirror of official site: http://jasper-net.blogspot.com/

Advanced WPF Localization

| Sunday, September 11, 2011
Localization in XAML  

To localize your text, images, etc. in XAML do the following:

1. Open the default resource file created by VS in your WPF application project. It is located in "Properties\Resources.resx".

2. Create entries in the string resources of the file. For example enter "HelloWorld" for name and "Hello World!" for value.

3. Use the following syntax to display the text in your application:

<TextBlock Text="{Loc HelloWorld}" />

That's it. You can localize any string in your application that way.

To localize an image (if you need culture-specific images) add the image in the "Images" section of the resource file and set its name. Then reference the image in your application by its name. For example if you add an image and name it "MyImage" use the following in XAML to display it:

<Image Source="{Loc MyImage}" />  


Read more: Codeproject
QR: AdvancedWPFLocalization2.aspx

Posted via email from Jasper-net

0 comments: