Skip to content

[i18n] Extract hardcoded error strings to resource files #1178

@iammukeshm

Description

@iammukeshm

Problem

Error messages are hardcoded throughout the codebase.

Examples

throw new NotFoundException("$"Group with ID '{command.Id}' not found.");
throw new CustomException("Toggle status failed", errors);
await context.Response.WriteAsync("Endpoint not found.");

Files affected

  • All handlers with validation
  • Exception messages
  • Response messages

Suggested approach

  1. Create Resources/ErrorMessages.resx
  2. Use IStringLocalizer<T> for messages
  3. Create constants for error codes

Impact

  • Cannot localize application
  • Inconsistent error messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions