Skip to content

Conversation

aide-cloud
Copy link

Description (what this PR does / why we need it):

error adds context support and i18n functionality

  • Add context package import to errors.go
  • Generate ErrorWithContext function in errorsTemplate.tpl
  • Implement NewWithContext function in errors/errors.go
  • Create i18n.go to handle internationalization
  • Add RegisterI18nManager function for global i18n manager
  • Add unit tests for NewWithContext function

Which issue(s) this PR fixes (resolves / be part of):

resolves #3619

- Add context package import to errors.go
- Generate ErrorWithContext function in errorsTemplate.tpl
- Implement NewWithContext function in errors/errors.go
- Create i18n.go to handle internationalization
- Add RegisterI18nManager function for global i18n manager
- Implement mock I18n interface and text formatter
- Add tests for NewWithContext when globalI18n is nil and not nil
- Verify error creation and localized message functionality
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 8, 2025
- Capitalize first letter of error messages in test cases
- Ensure consistency in error message formatting
- Replace inline struct initialization with a call to New function
- Improve code readability and maintainability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] error adds context support and i18n functionality

1 participant