Translating Identity in English

Asked

Viewed 1,675 times

6

I’m using the Identity on my application MVC 5.2.3

Microsoft.AspNet.Identity.Core 2.2.1

also installed the translation package of the same

Microsoft.AspNet.Identity.Core.pt-br 2.2.1
Microsoft.AspNet.Mvc.pt-br 5.2.3
Microsoft.Owin.pt-br 3.1.0

But some error messages are still in English.

Passwords must have at least one Digit ('0'-'9').

I checked and the file EditUserViewModel.cs is with all validation texts in en

No web.config tbm setei

<globalization uiCulture="pt" culture="pt-BR" enableClientBasedCulture="false" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />

What’s left for this message to stay in?

  • See if this link of Soen can help

  • Young man, where did you tag globalization on your web.config?

  • @LINQ is the first tag after opening <system.web>

2 answers

2


Hello, you need to go on Global.asax and add the method below.

protected void Application_BeginRequest(object sender, EventArgs e)
        {
            CultureInfo ci = new CultureInfo("pt-BR");
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
            System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ci.Name);
        }
  • 1

    I believe this has already been done, by the web.config statement in the question. This statement would only duplicate or overwrite what was done on the web.config.

  • I had the same problem when I used the configuration of web.config, but when reading a little more the documentation I found this solution and it worked perfectly for my application

  • really found redudante, pq here arrow in code what I defined in web.config, but by initial tests, it worked! thing of the devil!

  • I do not know if it is a good practice, the code worked, converted the translation, but since then it is perceived slightly a performance drop in the application.

-2

Do a search for the phrase, because if I’m not mistaken it is in the settings part of the password. I don’t remember exactly where, but it’s in the rule setting part of the password, where for example, you tell Identity that the password needs to have letters, numbers and symbols.

I think it’s in the Applicationusermanager.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.