Skip to content

Add debugOutput flag to localization attributes for design-time diagnostics #19

@dparvin

Description

@dparvin

When working in the Windows Forms designer, it can be difficult to diagnose issues with resource localization — especially when the output silently falls back to the resource key. To improve the debugging experience, particularly at design time, this issue proposes adding an optional debugOutput parameter to all localization-related attributes.

This would allow developers to temporarily enable rich, diagnostic fallback strings (e.g., [[ResourcePath::ResourceKey]]) when a resource lookup fails.

Goals

Add a debugOutput (or showDiagnostics) parameter to:

  • LocalizedEnumTextAttribute
  • LocalizedDisplayNameAttribute
  • LocalizedDescriptionAttribute
  • LocalizedCategoryAttribute

When debugOutput == true and the localized value is missing, display something like:

[[Namespace.Resources::DisplayName_MyEnum]]

  • Ensure fallback string works in both design-time (PropertyGrid) and runtime
  • Avoid use of global flags (Support.EnableResourceDebugInfo) to ensure design-time compatibility
  • Ensure behavior is opt-in and can be removed after debugging

Benefits
-✅ Simplifies debugging of missing or misnamed resources
-✅ Works inside the Visual Studio designer
-✅ Doesn't require changes to runtime behavior or environment
-✅ Easy to enable/disable by modifying the attribute

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions