# rent-a-developer/resxlocalization architecture

> Architecture diagram of the GitHub repository rent-a-developer/resxlocalization, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rent-a-developer/resxlocalization
- Repository: https://github.com/rent-a-developer/resxlocalization

## Overview

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: [`src/ResXLocalization.Core/Localizer.cs`](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/Localizer.cs) (Localizer), [`src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs`](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs) (Formatted binding converter), [`src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs`](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs) (Live text observable), [`src/ResXLocalization.Avalonia/LocalizeExtension.cs`](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizeExtension.cs) (Localize extension)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Key generation"]
  node_generator["Key generator"]
  node_typedkeys["Typed keys"]
end

subgraph group_core["Localization core"]
  node_resourcekey["ResourceKey<br/>[ResourceKey.cs]"]
  node_localizer["Localizer<br/>[Localizer.cs]"]
  node_ilocalizer["ILocalizer service<br/>[ILocalizer.cs]"]
  node_enumconvention["Enum key convention"]
  node_translationevent["Missing-key diagnostics"]
end

subgraph group_avalonia["Avalonia integration"]
  node_avaloniaextension["Localize extension"]
  node_avaloniaobservable["Live text observable"]
  node_avaloniaargs["Format arguments<br/>[LocalizeArgs.cs]"]
  node_avaloniaenum["Enum localization"]
end

subgraph group_wpf["WPF integration"]
  node_wpfextension["Localize extension"]
  node_wpfconverter["Formatted binding converter"]
  node_wpfargs["Format arguments<br/>[LocalizeArgs.cs]"]
  node_wpfenum["Enum localization"]
end

node_app(("Application developer"))
node_resx[".resx resources"]
node_ui["Localized UI"]

node_app -->|"provides"| node_resx
node_resx -->|"parsed with designer"| node_generator
node_generator -->|"emits"| node_typedkeys
node_app -->|"registers resources"| node_localizer
node_app -.->|"injects optionally"| node_ilocalizer
node_app -->|"sets culture"| node_localizer
node_typedkeys -->|"creates"| node_resourcekey
node_avaloniaextension -->|"resolves through"| node_localizer
node_wpfextension -->|"resolves through"| node_localizer
node_avaloniaextension -->|"creates binding"| node_avaloniaobservable
node_avaloniaobservable -->|"reads arguments"| node_avaloniaargs
node_avaloniaobservable -->|"emits localized text"| node_ui
node_avaloniaenum -->|"looks up enum key"| node_localizer
node_avaloniaenum -->|"emits localized text"| node_ui
node_wpfextension -->|"creates binding"| node_wpfconverter
node_wpfconverter -->|"reads arguments"| node_wpfargs
node_wpfconverter -->|"resolves through"| node_localizer
node_wpfconverter -->|"converts to text"| node_ui
node_wpfenum -->|"looks up enum key"| node_localizer
node_localizer -->|"builds enum key"| node_enumconvention
node_localizer -->|"raises on miss"| node_translationevent
node_localizer -->|"reads registered resources"| node_resx

click node_generator "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs"
click node_typedkeys "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs"
click node_resourcekey "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/ResourceKey.cs"
click node_localizer "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/Localizer.cs"
click node_ilocalizer "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/ILocalizer.cs"
click node_enumconvention "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/EnumKeyConvention.cs"
click node_translationevent "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/TranslationNotFoundEventArgs.cs"
click node_avaloniaextension "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizeExtension.cs"
click node_avaloniaobservable "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs"
click node_avaloniaargs "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizeArgs.cs"
click node_avaloniaenum "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizedEnumObservable.cs"
click node_wpfextension "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeExtension.cs"
click node_wpfconverter "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs"
click node_wpfargs "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeArgs.cs"
click node_wpfenum "https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeEnumConverter.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_generator,node_typedkeys,node_ui toneBlue
class node_resourcekey,node_localizer,node_ilocalizer,node_enumconvention,node_translationevent toneAmber
class node_avaloniaextension,node_avaloniaobservable,node_avaloniaargs,node_avaloniaenum toneMint
class node_wpfextension,node_wpfconverter,node_wpfargs,node_wpfenum toneRose
class node_app,node_resx toneIndigo
```

## Components

### Key generation

- [Key generator](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs): `src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs`
- [Typed keys](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs): `src/ResXLocalization.SourceGenerators/ResxKeysGenerator.cs`

### Localization core

- [ResourceKey](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/ResourceKey.cs): `src/ResXLocalization.Core/ResourceKey.cs`
- [Localizer](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/Localizer.cs): `src/ResXLocalization.Core/Localizer.cs`
- [ILocalizer service](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/ILocalizer.cs): `src/ResXLocalization.Core/ILocalizer.cs`
- [Enum key convention](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/EnumKeyConvention.cs): `src/ResXLocalization.Core/EnumKeyConvention.cs`
- [Missing-key diagnostics](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Core/TranslationNotFoundEventArgs.cs): `src/ResXLocalization.Core/TranslationNotFoundEventArgs.cs`

### Avalonia integration

- [Localize extension](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizeExtension.cs): `src/ResXLocalization.Avalonia/LocalizeExtension.cs`
- [Live text observable](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs): `src/ResXLocalization.Avalonia/LocalizedFormattedTextObservable.cs`
- [Format arguments](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizeArgs.cs): `src/ResXLocalization.Avalonia/LocalizeArgs.cs`
- [Enum localization](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.Avalonia/LocalizedEnumObservable.cs): `src/ResXLocalization.Avalonia/LocalizedEnumObservable.cs`

### WPF integration

- [Localize extension](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeExtension.cs): `src/ResXLocalization.WPF/LocalizeExtension.cs`
- [Formatted binding converter](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs): `src/ResXLocalization.WPF/LocalizedFormattedStringConverter.cs`
- [Format arguments](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeArgs.cs): `src/ResXLocalization.WPF/LocalizeArgs.cs`
- [Enum localization](https://github.com/rent-a-developer/resxlocalization/blob/main/src/ResXLocalization.WPF/LocalizeEnumConverter.cs): `src/ResXLocalization.WPF/LocalizeEnumConverter.cs`

### Other components

- **Application developer**
- **.resx resources**
- **Localized UI**

## Connections

- 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
