Quantcast
Channel: How to localize ASP.NET Identity UserName and Password error messages? - Stack Overflow
Browsing latest articles
Browse All 25 View Live

Answer by SM Mirabolghasemi for How to localize ASP.NET Identity UserName and...

I added this package to my project:PiotrTrojan.AspNetCore.IdentityErrorLocalizationAnd I simply added this line of code in Program.csbuilder.Services.AddIdentity<User, IdentityRole>(options...

View Article



Answer by ertugrulakdag for How to localize ASP.NET Identity UserName and...

for PasswordContainseSequence example public static string IdentityErrorToTurkish(string code, string description) { switch (code) { case "PasswordContainseSequence": description = "Parola sayısal sıra...

View Article

Answer by cdie for How to localize ASP.NET Identity UserName and Password...

French version (with C# 9 syntax) :public class FrenchIdentityErrorDescriber : IdentityErrorDescriber{ public override IdentityError DefaultError() => new() { Code = nameof(DefaultError),...

View Article

Answer by Viktor Kozenko for How to localize ASP.NET Identity UserName and...

Ukrainian translation for Andrew Basarab answerResource file data:<data name="ConcurrencyFailure" xml:space="preserve"><value>Помилкапаралельності,...

View Article

Answer by Mustafa Can Karaoğlu for How to localize ASP.NET Identity UserName...

Here is IdentityErrorDescriber's Turkish Translationusing Microsoft.AspNetCore.Identity;public class TurkishIdentityErrorDescriber : IdentityErrorDescriber{ public override IdentityError DefaultError()...

View Article


Answer by nforss for How to localize ASP.NET Identity UserName and Password...

Based on the answers here, I made my own implementation for our multilanguage web site built on MVC Core 2.2, where the strings cannot be hard coded.I'm using a basic resource file with auto generated...

View Article

Answer by Mahdi Moeinifar for How to localize ASP.NET Identity UserName and...

this is for dear Farsi(Persian) speakersusing Microsoft.AspNetCore.Identity;namespace WebApplication.Admin.Helpers{ public class CustomIdentityErrorDescriber : IdentityErrorDescriber { public override...

View Article

Answer by René for How to localize ASP.NET Identity UserName and Password...

German Version for Solution by @GerardoGrignolipublic class CustomIdentityErrorDescriber : IdentityErrorDescriber{ public override IdentityError DefaultError() { return new IdentityError { Code =...

View Article


Answer by kamil062 for How to localize ASP.NET Identity UserName and Password...

Polish versionpublic class CustomErrorDescriber : IdentityErrorDescriber{ public override IdentityError DefaultError() { return new IdentityError { Code = nameof(DefaultError), Description = $"Wystąpił...

View Article


Answer by Peter Barbanyaga for How to localize ASP.NET Identity UserName and...

In addition to @Gerardo Grinolli answer this translated versions for Russian:public class CustomIdentityErrorDescriber : IdentityErrorDescriber{ public override IdentityError DefaultError() { return...

View Article

Answer by Omar Altawyan for How to localize ASP.NET Identity UserName and...

Hi Here My Solution to to translate identity errors: public string TranslateIdentityResult(string massage) { var list = new List<KeyValuePair<string, string>>() { new...

View Article

Answer by Ahmad Badkoubehei for How to localize ASP.NET Identity UserName and...

I managed to find a solution to create localized version of AspNet.Identity for cultures that no ready-to-use package is available for. Steps are:Download the source code from GitHub and open the...

View Article

Answer by Mathieu VIALES for How to localize ASP.NET Identity UserName and...

Here is Gerardo Grignoli's answer with French translation/// <inheritdoc />/// <summary>/// Service to enable localization (french) for application facing identity errors.///...

View Article


Answer by Daniel for How to localize ASP.NET Identity UserName and Password...

I don't want to override the logic (i.e., re-invent the wheel), nor do I want to switch to ASP NET Core. All I want to do is override the error messages and use multiple resource files (per language)...

View Article

Answer by Andrew Basarab for How to localize ASP.NET Identity UserName and...

ASP NET Core workaround (25.11.2016)You can inject IStringLocalizer into custom IdentityErrorDescriber1) Create custom IdentityErrorDescriber (see Gerardo Grignoli answer)public class...

View Article


Answer by Donald Fraser for How to localize ASP.NET Identity UserName and...

Having come across the same problem one can provide your own resource files to achieve this. Of course it requires a bit of reflection hacking!First you will need to be running with full security, ie...

View Article

Answer by Hernan Demczuk for How to localize ASP.NET Identity UserName and...

My solution was a little bit dirty but It works as expected. The idea is to assign all the errors that the IdentityResult object result brings when we register a new user:var result = await...

View Article


Answer by Gerardo Grignoli for How to localize ASP.NET Identity UserName and...

For ASP.NET Core: (Microsoft.AspNetCore.Identity 1.0.0)Create a class that inherits IdentityErrorDescriber and override the desired error messages.public class CustomIdentityErrorDescriber :...

View Article

Answer by Michal Hosala for How to localize ASP.NET Identity UserName and...

This issue was bothering me for quite some time already so I tried to come up with something generic, because solution with installing Identity.Core for particular culture is only working if the...

View Article

Answer by Ignacio for How to localize ASP.NET Identity UserName and Password...

Let me share with you what I´ve done to accomplish this in Spanish. There you can customize the messages easily!string Errores = result.Errors.FirstOrDefault();Errores = Errores.Replace("Name "+...

View Article

Answer by Marselus Chia for How to localize ASP.NET Identity UserName and...

My solution is to create new custom password validation class inherits from Microsoft.AspNet.Identity.PasswordValidator, Overrides the ValidateAsync which is the one that send out the error message....

View Article


Answer by viking for How to localize ASP.NET Identity UserName and Password...

1AmirJalali's method works perfectly. While setting culture in web.config works, it can be set dynamically also if required, here is how this can be achieved:Thread.CurrentThread.CurrentCulture = new...

View Article


Answer by Amir Jalali for How to localize ASP.NET Identity UserName and...

As of version 2 of identity which released on 20 march 2014 you can now have localized error messages.First install the identity localized package.Install-Package Microsoft.AspNet.Identity.Core.frThen...

View Article

Answer by Cristian Lupascu for How to localize ASP.NET Identity UserName and...

I ran into the same problem and found a quick-and-dirty workaround. I looked inside the Microsoft.AspNet.Identity.Core assembly using DotPeek (I assume any C# decompiler will do) and found two classes...

View Article

How to localize ASP.NET Identity UserName and Password error messages?

Is it possible to provide localized strings for the "system" ASP.NET Identity v1 error messages, like "Name XYZ is already taken" or "User name XYZ is invalid, can only contain letters or digits"?

View Article

Browsing latest articles
Browse All 25 View Live




Latest Images