localization
Implement localization for the .NET 8 WPF widget host app using resource files, culture switching, and RTL considerations. Use when adding RESX resources, binding localized strings, or supporting multiple cultures.
📖 中文导读:Implement localization for the .NET 8 WPF widget host app using resource files, culture switching, and RTL considerations. Use when adding RESX resources, binding localized strings, or supporting multiple cultures. 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: localization description: Implement localization for the .NET 8 WPF widget host app using resource files, culture switching, and RTL considerations. Use when adding RESX resources, binding localized strings, or supporting multiple cultures.
Localization
Overview
Deliver localized UI text and culture-aware formatting with runtime culture switching.
Core areas
- RESX resources and resource dictionaries
- Culture switching at runtime
- RTL layout considerations
Definition of done (DoD)
- No hardcoded user-visible strings in XAML or code
- All strings in RESX files with stable keys
- Dates/numbers use culture-aware formatting
- Culture switching works without app restart
- UI tested in at least one RTL language if RTL support is claimed
Workflow
- Define base resources and culture-specific RESX files.
- Bind localized strings in XAML or view models.
- Implement runtime culture switching in the shell.
- Validate RTL layouts for languages that require it.
Guidance
- Keep resource keys stable and descriptive.
- Use culture-aware formatting for dates and numbers.
- Avoid hard-coded UI strings.
References
references/resources.mdfor RESX patterns.references/culture-switching.mdfor runtime switch guidance.references/rtl.mdfor RTL layout considerations.