Skip to content

Conversation

@maliming
Copy link
Member

@maliming maliming commented Jan 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 9, 2026 11:27
@maliming maliming added this to the 10.1-final milestone Jan 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AbpIdentityErrorDescriber to override all IdentityErrorDescriber methods, providing localized descriptions at error creation time
  • Removed complex error message parsing logic from AbpIdentityResultExtensions (including reflection-based extraction of error message parameters)
  • Simplified AbpIdentityResultException by removing ILocalizeErrorMessage interface and localization methods since errors are now pre-localized
  • Updated AbpIdentityUserValidator and IdentityUserManager to use manager.ErrorDescriber consistently

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

@maliming maliming requested a review from EngincanV January 9, 2026 12:23
maliming and others added 3 commits January 9, 2026 20:57
…Identity/AbpIdentityErrorDescriber_Tests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Identity/AbpIdentityErrorDescriber_Tests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Identity/AbpIdentityErrorDescriber_Tests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@EngincanV EngincanV merged commit 98678e7 into rel-10.1 Jan 13, 2026
3 checks passed
@EngincanV EngincanV deleted the AbpIdentityErrorDescriber branch January 13, 2026 11:15
@roc916
Copy link
Contributor

roc916 commented Jan 18, 2026

Will it affect the serialization of remote service information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants