Conversation
…`AbpIdentityResultExtensions`.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the Identity module's error message localization strategy by moving from post-hoc localization via AbpIdentityResultExtensions to localizing at the source through AbpIdentityErrorDescriber. This approach is cleaner and more aligned with ASP.NET Core Identity's design, as error descriptions are now localized immediately when errors are created rather than being translated after the fact.
Key changes:
- Expanded
AbpIdentityErrorDescriberto override allIdentityErrorDescribermethods, providing localized descriptions at error creation time - Removed complex error message parsing logic from
AbpIdentityResultExtensions(including reflection-based extraction of error message parameters) - Simplified
AbpIdentityResultExceptionby removingILocalizeErrorMessageinterface and localization methods since errors are now pre-localized - Updated
AbpIdentityUserValidatorandIdentityUserManagerto usemanager.ErrorDescriberconsistently
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| AbpIdentityErrorDescriber_Tests.cs | New comprehensive test file covering all error describer methods with multi-language validation (en, tr, zh-Hans) and integration tests with UserManager/RoleManager |
| AbpIdentityResultException_Tests.cs | Removed - old test for post-hoc localization approach no longer needed |
| AbpIdentityErrorDescriber.cs | Expanded to implement all 19 IdentityErrorDescriber methods with localized descriptions |
| AbpIdentityResultExtensions.cs | Removed complex error localization logic (LocalizeErrors, LocalizeErrorMessage, GetValuesFromErrorMessage methods) and reflection-based resource extraction |
| AbpIdentityResultException.cs | Simplified by removing ILocalizeErrorMessage interface and related localization methods |
| AbpIdentityUserValidator.cs | Updated to use manager.ErrorDescriber instead of creating manual IdentityError objects with direct localization |
| IdentityUserManager.cs | Fixed to use ErrorDescriber property instead of creating new IdentityErrorDescriber instance |
| IdentityUserAppService_Tests.cs | Updated test assertion to expect full localized concurrency error message |
...ity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityErrorDescriber_Tests.cs
Outdated
Show resolved
Hide resolved
...ity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityErrorDescriber_Tests.cs
Outdated
Show resolved
Hide resolved
...ity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityErrorDescriber_Tests.cs
Outdated
Show resolved
Hide resolved
…Identity/AbpIdentityErrorDescriber_Tests.cs Co-authored-by: Copilot <[email protected]>
…Identity/AbpIdentityErrorDescriber_Tests.cs Co-authored-by: Copilot <[email protected]>
…Identity/AbpIdentityErrorDescriber_Tests.cs Co-authored-by: Copilot <[email protected]>
EngincanV
approved these changes
Jan 13, 2026
Contributor
|
Will it affect the serialization of remote service information? |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.