1

In my ASP MVC 3 site I added a folder Resources with 2 Resx files Strings.resx and Strings.fr-FR.resx, Acces modifier public, and provided translation.

I added in web.config:

<system.web>
    <globalization culture="Auto" uiCulture="Auto"/>  

and

<configuration>
  <appSettings>
    <add key="culture" value="fr-FR" />
    <add key="uiculture" value="fr-FR" />

I also forced french language in CurrentCulture and CurrentUICulture in Application_AuthenticateRequest and Application_BeginRequest in global.asax.

The problem is when displaying site in localhost, the language is translated in french.

When deploying the site on the server (after building the msi in a WebSetup project) The strings are not translated in french language although both culture and ui culture are "fr-FR" (displayed them in input hidden).

What can be the problem? Maybe something is missing in the config server? I can't find any issue about that in the internet.

Thanks.

Ghassen Hamrouni
  • 3,138
  • 2
  • 20
  • 31
addex03
  • 197
  • 1
  • 2
  • 12

3 Answers3

1

Try to follow this approach is great http://afana.me/post/aspnet-mvc-internationalization-part-2.aspx

0

Check if you have published the folder containing the translation to fr-FR, in my case I did the translation in en-US and in the bin folder there is a sub-folder called en-US that contains the dll of the resource with the translation.

0

It could be that the production server has different language sets and with that

Thread.CurrentThread.CurrentUICulture

is set automatically... but this is just a guess since I do not know enough about your implementation...

but...

Here is a good, detailed article on that topic...

Globalization, Internationalization and Localization in ASP.NET MVC 3, JavaScript and jQuery - Part 1

http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx

silverfighter
  • 6,762
  • 10
  • 46
  • 73