Translating Identity

I'm using Identity in my application MVC 5.2.3

Microsoft.AspNet.Identity.Core 2.2.1

I 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 the validation texts in pt-br

No web.config TBM thirst

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

What is missing for this message to be in pt-br?

Author: Dorathoto, 2017-09-01

2 answers

Hello, you need to go 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);
        }
 2
Author: AL_Mauricio, 2017-09-11 21:52:44

Do a search for the phrase, because if I'm not mistaken it is in the settings part of the password. I do not remember exactly where, but it is in the part of settings rules for creating the password, where for example, vc tells Identity that the password needs to have letters, numbers and symbols.

I think it stays in the ApplicationUserManager.

 -2
Author: Manacés Pereira, 2017-09-11 14:20:53