Localizes WPF applications using BAML localization with x:Uid attributes and LocBaml tool. Use when building enterprise multi-language applications requiring satellite assemblies.
View on GitHubchristian289/dotnet-with-claudecode
wpf-dev-pack
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/christian289/dotnet-with-claudecode/blob/main/wpf-dev-pack/skills/localizing-wpf-with-baml/SKILL.md -a claude-code --skill localizing-wpf-with-bamlInstallation paths:
.claude/skills/localizing-wpf-with-baml/# WPF BAML Localization
Localize WPF applications using x:Uid attributes and LocBaml tool for satellite assembly generation.
## 1. BAML Localization Overview
```
BAML Localization Workflow
├── 1. Add x:Uid to XAML elements
├── 2. Set UICulture in project
├── 3. Build to generate default resources
├── 4. Extract with LocBaml /parse
├── 5. Translate CSV files
└── 6. Generate satellite assemblies with LocBaml /generate
```
**When to use BAML:**
- Enterprise applications with professional translation workflow
- Need to localize without recompiling
- Complex UI with many localizable properties
---
## 2. Adding x:Uid Attributes
```xml
<Window x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Uid="MainWindow"
Title="My Application">
<Grid x:Uid="MainGrid">
<StackPanel x:Uid="ContentPanel">
<TextBlock x:Uid="TitleText" Text="Welcome to My Application"/>
<TextBlock x:Uid="DescriptionText" Text="Please select an option below."/>
<Button x:Uid="SaveButton" Content="Save"/>
<Button x:Uid="CancelButton" Content="Cancel"/>
<Button x:Uid="HelpButton" Content="Help" ToolTip="Click for help"/>
</StackPanel>
</Grid>
</Window>
```
**x:Uid naming conventions:**
- Use descriptive names: `SaveButton`, `TitleText`
- Unique within the XAML file
- Applied to elements with localizable properties
---
## 3. Project Configuration
### 3.1 Set UICulture
```xml
<!-- .csproj -->
<PropertyGroup>
<UICulture>en-US</UICulture>
</PropertyGroup>
```
### 3.2 Build Output Structure
```
bin/Release/
├── MyApp.exe
├── MyApp.resources.dll
└── ko-KR/
└── MyApp.resources.dll ← Korean satellite assembly
```
---
## 4. LocBaml Tool Usage
### 4.1 Extract Resources
```bash
# Parse and extract to CSV
LocBaml /parse MyApp.resources.dll /out:en-US.csv
```
**CSV output format:**