Internationalization Issues Using MVC Filter

I have a .NET 4.5.2 application with localized resource files (Messages.resx (for pt), Messages.es.resx and Messages.en.resx).

The MVC filter establishes a stream culture based on the client language.

I published on a farm with 3 servers, and it worked fine for some time, and suddenly the following behavior started:

  • One of the servers began to respond to requests using the pt culture with English messages.
  • In addition, messages that are not translated into English and are found only in the Messages.resx file are returned empty.
  • If the client language is a server, the server returns with Spanish messages.

We changed the farm servers and this happened on 4 different servers.

I tried to include [assembly: NeutralResourcesLanguage ("pt")] in AssemblyInfo, but the problem is still happening.

Can someone help me solve this problem?

+4
source share
1 answer

'The MVC filter establishes a flow culture based on the client language.

Why? IIS can do this automatically. Using:

<globalization uiCulture="auto" culture="auto" />

in the system.web section of your web.config

+1
source

Source: https://habr.com/ru/post/1689969/


All Articles