Change Cultureinfo to MVC5 / C# and Multi-tenancy

Asked

Viewed 34 times

1

Good afternoon folks! I am working with MVC5 and need a help in the following situation.. I have a view that contains a language selector, and needs to dynamically change the content after selecting the desired language. I already have the . resx files and capturing the "set" language in select however the page content is not translated. After changing the Currentuiculture I am giving a "Return View()".

I have in view:

  <div class="form-group" >
     <select id="idioma"  onchange="VerificarIdioma()" class="form-control" style=" border-color: #FFFFFF;">
       <option id="pt-BR" ng-selected="selected">Português (Brasil)</option>
       <option id="es-CL">Español (Chile)</option>
       <option id="es-ES">Español (España)</option>
       <option id="en-US">English (USA)</option>
     </select>
  </div>

And I thought to use in the file . Tenant’s Cs the following:

  Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
  Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");

Where "en-US" should be the selected item in select.

Please, could someone help me?

No answers

Browser other questions tagged

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