localizing-wpf-with-bamllisted
Install: claude install-skill christian289/dotnet-with-claudecode
# 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 localiza