How rent-a-developer/resxlocalization works
ResXLocalization provides type-safe .resx localization and live language switching for Avalonia and WPF. The main workflow is: an application supplies .resx resources, the generator emits typed keys, the app registers resource managers and selects a culture, and framework bindings resolve and refresh localized text. Core lookup also supports formatting, enums, culture discovery, and missing-translation diagnostics. UI integration details are represented from the README and sampled source; some subsystem wiring is documented but its implementation was not sampled.
Main entry points: Localizer.cs Localizer · LocalizedFormattedStringConverter.cs Formatted binding converter · LocalizedFormattedTextObservable.cs Live text observable · LocalizeExtension.cs Localize extension
Components 18
Key generation
- Key generator
src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs - Typed keys
src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs
Localization core
- ResourceKey
src/ResXLocalization.Core/ResourceKey.cs - Localizer
src/ResXLocalization.Core/Localizer.cs - ILocalizer service
src/ResXLocalization.Core/ILocalizer.cs - Enum key convention
src/ResXLocalization.Core/EnumKeyConvention.cs - Missing-key diagnostics
src/ResXLocalization.Core/TranslationNotFoundEventArgs.cs
Avalonia integration
- Localize extension
src/ResXLocalization.Avalonia/LocalizeExtension.cs - Live text observable
src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs - Format arguments
src/ResXLocalization.Avalonia/LocalizeArgs.cs - Enum localization
src/ResXLocalization.Avalonia/LocalizedEnumObservable.cs
WPF integration
- Localize extension
src/ResXLocalization.WPF/LocalizeExtension.cs - Formatted binding converter
src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs - Format arguments
src/ResXLocalization.WPF/LocalizeArgs.cs - Enum localization
src/ResXLocalization.WPF/LocalizeEnumConverter.cs
Other components
- Application developer
- .resx resources
- Localized UI
Connections 22
- Application developer → .resx resources: provides
- .resx resources → Key generator: parsed with designer
- Key generator → Typed keys: emits
- Application developer → Localizer: registers resources
- Application developer → ILocalizer service: injects optionally
- Application developer → Localizer: sets culture
- Typed keys → ResourceKey: creates
- Localize extension → Localizer: resolves through
- Localize extension → Localizer: resolves through
- Localize extension → Live text observable: creates binding
- Live text observable → Format arguments: reads arguments
- Live text observable → Localized UI: emits localized text
- Enum localization → Localizer: looks up enum key
- Enum localization → Localized UI: emits localized text
- Localize extension → Formatted binding converter: creates binding
- Formatted binding converter → Format arguments: reads arguments
- Formatted binding converter → Localizer: resolves through
- Formatted binding converter → Localized UI: converts to text
- Enum localization → Localizer: looks up enum key
- Localizer → Enum key convention: builds enum key
- Localizer → Missing-key diagnostics: raises on miss
- Localizer → .resx resources: reads registered resources