Localizes WPF applications using resource files, x:Uid, and BAML localization. Use when building multi-language applications or supporting right-to-left layouts.
View on GitHubchristian289/dotnet-with-claudecode
wpf-dev-pack
January 23, 2026
Select agents to install to:
npx add-skill https://github.com/christian289/dotnet-with-claudecode/blob/main/wpf-dev-pack/skills/localizing-wpf-applications/SKILL.md -a claude-code --skill localizing-wpf-applicationsInstallation paths:
.claude/skills/localizing-wpf-applications/# WPF Localization Patterns
Implementing multi-language support in WPF applications.
## 1. Localization Overview
```
Localization Approaches
├── Resource Files (.resx)
│ ├── Simple string lookup
│ └── Strongly-typed access
├── BAML Localization
│ ├── x:Uid attributes
│ └── LocBaml tool
└── Runtime Features
├── FlowDirection (RTL support)
├── Culture-aware formatting
└── Dynamic language switching
```
---
## 2. Resource File Approach
### 2.1 Creating Resource Files
```
Project Structure:
├── Properties/
│ └── Resources.resx (default/fallback)
├── Resources/
│ ├── Strings.resx (default English)
│ ├── Strings.ko-KR.resx (Korean)
│ ├── Strings.ja-JP.resx (Japanese)
│ └── Strings.de-DE.resx (German)
```
### 2.2 Resource File Content
**Strings.resx (English - default):**
```xml
<data name="AppTitle" xml:space="preserve">
<value>My Application</value>
</data>
<data name="WelcomeMessage" xml:space="preserve">
<value>Welcome, {0}!</value>
</data>
<data name="SaveButton" xml:space="preserve">
<value>Save</value>
</data>
<data name="CancelButton" xml:space="preserve">
<value>Cancel</value>
</data>
```
**Strings.ko-KR.resx (Korean):**
```xml
<data name="AppTitle" xml:space="preserve">
<value>My Application (Korean translation)</value>
</data>
<data name="WelcomeMessage" xml:space="preserve">
<value>Welcome, {0}! (Korean translation)</value>
</data>
<data name="SaveButton" xml:space="preserve">
<value>Save (Korean translation)</value>
</data>
<data name="CancelButton" xml:space="preserve">
<value>Cancel (Korean translation)</value>
</data>
```
### 2.3 Using Resources in XAML
```xml
<Window xmlns:p="clr-namespace:MyApp.Resources">
<Window.Title>
<Binding Source="{x:Static p:Strings.AppTitle}"/>
</Window.Title>
<StackPanel>
<TextBlock Text="{x:Static p:Strings.WelcomeMessage}"/>
<Button Content="{x:Static p:Strings.SaveButton}"/>