✨ Feature Request: Fallback from LocalizedEnumTextAttribute → EnumTextAttribute
Overview
Provide a graceful fallback so that when a localized string is not found, the value from an accompanying
EnumTextAttribute is used instead.
This enables incremental migration from static enum labels to fully‑localized strings without breaking the UI.
Proposed Flow
- Localized string found → return it.
- Localized string missing
- Debug mode ON → return a diagnostic placeholder
[[Namespace.ResourceKey]]
- Debug mode OFF →
- If the enum field has an
EnumTextAttribute, return its Text.
- Otherwise fall back to the raw enum name.
┌───────────┐
│ Exists? │── Yes ──► return localized
└────┬──────┘
No
│
▼
┌───────────┐ debug?
│ Debug ON? │── Yes ──► [[ResourcePath::Key]]
└────┬──────┘
No
│
▼
┌────────────────────────────┐
│ EnumTextAttribute present? │── Yes ──► return EnumText.Text
└────┬───────────────────────┘
No
│
▼
return enum name
Benefits
- Incremental migration – keep existing EnumText values until resource strings are ready.
- No UI regressions – end‑users never see raw resource keys.
- Debug visibility – missing keys stand out in debug builds.
- Easy cleanup – once all keys are localized, remove obsolete EnumText attributes.
Implementation Notes
- Logic can live inside LocalizedEnumTextAttribute.GetLocalizedText() or a helper like Support.GetEnumDisplayText(...).
- Throw ArgumentException on ResourceUsage.None (consistent with other helpers).
- Add comprehensive unit tests covering:
- localized found
- debug placeholder
- EnumText fallback
- final enum‑name fallback.
✨ Feature Request: Fallback from
LocalizedEnumTextAttribute→EnumTextAttributeOverview
Provide a graceful fallback so that when a localized string is not found, the value from an accompanying
EnumTextAttributeis used instead.This enables incremental migration from static enum labels to fully‑localized strings without breaking the UI.
Proposed Flow
[[Namespace.ResourceKey]]EnumTextAttribute, return itsText.Benefits
Implementation Notes