Open Closed

Change Localization String in UserManager #439

moretl created


I would change default error message on UserManager base class. I see that this class use LocalizationManager but even if I add "Identity.DuplicateName" key with french traduction in my xml file, it doesn't work... I don't understand why Thanks

4 Answer(s)
  • 0
    ddnils created

    There are still some un-translated ui-exceptions in CreateExceptionForFailedLoginAttempt (AccountController), did you check that?

  • 0
    moretl created

    Thank you for your reply, but after searching , I come to the conclusion that the message is generated by the method AbpUserManager.CheckDuplicateUsernameOrEmailAddressAsync ... Here are its contents (<a class="postlink" href=",Version=v4.5.1/Abp.Zero/Abp.Zero/Authorization/Users/AbpUserManager.cs"> ... Manager.cs</a>) :

    public virtual async Task<IdentityResult> CheckDuplicateUsernameOrEmailAddressAsync(long? expectedUserId, string userName, string emailAddress) { var user = (await FindByNameAsync(userName)); if (user != null && user.Id != expectedUserId) { return AbpIdentityResult.Failed(string.Format(L("Identity.DuplicateName"), userName)); }

            user = (await FindByEmailAsync(emailAddress));
            if (user != null && user.Id != expectedUserId)
                return AbpIdentityResult.Failed(string.Format(L("Identity.DuplicateEmail"), emailAddress));
            return IdentityResult.Success;
  • 0
    hikalkan created
    Support Team


    Did you try to extend localization source? See <a class="postlink" href=""> ... cExtending</a> Thus, you can override default messages or add new languages.

  • 0
    moretl created

    Yes I try,

    I add a new entry in my xml file for localization with this key "Identity.DuplicateName" and french translation for value...

    but it doesn't work... I always see english default message :/