
Skill
maui-localization-theming
implement .NET MAUI localization and theming
Description
Implement .NET MAUI localization, runtime culture switching, RTL layout, platform language declarations, AppThemeBinding, DynamicResource theming, and light/dark/system theme switching. USE FOR: RESX/AppResources, DefaultThreadCurrentUICulture, Preferences-backed language choices, culture-aware formatting, FlowDirection, start/end assets, CFBundleLocalizations, AppThemeBinding, DynamicResource instead of StaticResource for live theme tokens, Application.Current.UserAppTheme, and AppTheme.Unspecified. DO NOT USE FOR: general layout, accessibility audits, or icon/splash assets.
SKILL.md
MAUI Localization and Theming
Use this skill when a MAUI app needs translated strings, culture-specific formatting, right-to-left support, or runtime theme changes.
Workflow
- Inspect existing
Resources,ResourceDictionary,App.xaml, and platform language declarations. - Put user-visible strings in RESX resources or the app's existing localization service.
- Use culture-aware formatting for dates, numbers, and currency.
- If runtime language switching is required, centralize culture updates and notify UI bindings.
- Add RTL support through
FlowDirectionand test with an RTL culture. - Define colors, spacing, and styles as resources.
- Use
AppThemeBindingfor simple light/dark values andDynamicResourcefor values that change at runtime. - Set
Application.Current.UserAppThemeonly when the user explicitly chooses a theme; useUnspecifiedfor system theme.
RESX Pattern
Use a default resource file plus culture-specific files:
Resources/Strings/AppResources.resx
Resources/Strings/AppResources.es.resx
Resources/Strings/AppResources.fr.resx
Reference generated resources from XAML or ViewModels instead of hard-coded strings. Keep resource keys stable and descriptive.
Runtime Culture Switching
When the user changes language:
- Set
CultureInfo.DefaultThreadCurrentCulture. - Set
CultureInfo.DefaultThreadCurrentUICulture. - Update any generated resource culture property if the app uses one.
- Notify bound localized strings, recreate affected pages, or use a localization manager that raises change notifications.
- Persist the selected culture in
Preferencesonly after the user chooses it.
Do not assume changing the thread culture automatically refreshes every existing binding. Existing pages usually need notification or recreation.
Platform Language Declarations
| Platform | Check |
|---|---|
| iOS/Mac Catalyst | Include supported localizations such as CFBundleLocalizations when platform language metadata is required. |
| Android | Confirm app language/resource configuration if using platform-specific localized resources. |
| Windows | Confirm package/resource language metadata if the app has Windows-specific resources. |
RTL Guidance
- Use
FlowDirection="MatchParent"for most pages and layouts. - Set
FlowDirection="RightToLeft"only when forcing a specific surface. - Avoid left/right naming in resources; prefer start/end semantics in code and design tokens.
- Verify icons and gestures that imply direction.
Theme Patterns
<ContentPage BackgroundColor="{AppThemeBinding Light=#FFFFFF, Dark=#111111}" />
<Label TextColor="{DynamicResource PrimaryTextColor}" />
Runtime theme changes should update resource dictionaries or
Application.Current.UserAppTheme:
Application.Current!.UserAppTheme = AppTheme.Dark;
Use DynamicResource for resources that must react after the page is created.
Use StaticResource only when values are not expected to change at runtime.
Validation Checklist
- User-visible strings are resource-backed.
- Culture changes update existing UI or intentionally recreate affected pages.
- RTL cultures have been considered for layout direction and icons.
- Theme resources use
AppThemeBindingorDynamicResourceappropriately. - User theme selection can return to system default.
More skills from the maui-labs repository
View all 32 skillsandroid-slim-bindings
create Android slim bindings for .NET
Jul 12.NETAndroidJavaKotlin +1devflow-automation
automate .NET MAUI app state
Jul 12.NETAutomationMAUIMobiledevflow-connect
diagnose DevFlow agent connectivity issues
Jul 12DebuggingMAUINetworkingdotnet-workload-info
discover MAUI workload metadata
Jul 12C#CLIEngineeringMAUIios-slim-bindings
create iOS slim bindings for MAUI
Jul 12.NETiOSMAUISwift +1maui-accessibility
implement accessibility in .NET MAUI apps
Jul 12.NETAccessibilityMAUIMobile +1
More from .NET (Microsoft)
View publishermultithreaded-task-migration
migrate MSBuild tasks to multithreaded mode
msbuild
Jul 22.NETEngineeringPerformanceanalyzing-dotnet-performance
analyze .NET code for performance anti-patterns
skills
Jul 12.NETCode AnalysisDebuggingPerformanceandroid-tombstone-symbolication
symbolicate .NET runtime frames in Android tombstones
skills
Jul 12.NETAndroidDebuggingMicrosoftapple-crash-symbolication
symbolicate .NET runtime frames in crash logs
skills
Jul 12.NETDebuggingiOSmacOS +1assertion-quality
evaluate assertion quality in test suites
skills
Jul 12Code AnalysisQATestingauthor-component
create and review Blazor components
skills
Jul 15.NETBlazorC#UI Components +1