Translating Identity en

5

I'm using Identity in my application MVC 5.2.3

Microsoft.AspNet.Identity.Core 2.2.1

I also installed the translation package for it

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 EditUserViewModel.cs file is with all the validation texts in pt-br

In web.config tbm setei

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

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

    
asked by anonymous 01.09.2017 / 19:59

2 answers

1

Hello, you need to go to 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);
        }
    
11.09.2017 / 23:52
-1

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

I think it stays in the ApplicationUserManager.

    
11.09.2017 / 16:14