1

I have added Resource.fr-FR.resx to my project and have done the globalization setting in web.config as follows.

<system.web>
    <globalization culture="fr-FR" uiCulture="fr"/>
</system.web>

that is all you need according to http://msdn.microsoft.com/en-us/library/bz9tc508%28v=vs.80%29.aspx

but when I run my app it is still in english

I have checked "Thread.CurrentThread.CurrentUICulture" in Application_Start() and it says FR.

what am I missing? the same thing has been posted in MVC 3 Setting uiCulture does not work

but no answers.

Community
  • 1
  • 1
user664889
  • 11
  • 1
  • 3

1 Answers1

1

Culture is not the same thing as Language. A "culture" is a set of formatting rules for dates/times, currency, calendaring, and a few other things (like text Title Casing rules).

Setting a culture will not automatically localize your application (where localization is when all of the human-readable strings are translated into another language, such as French). Localization and UI translation is a long, painful and expensive process. ASP.NET does not do it for you.

If you want to localize your application, you need to ensure that all human-readable strings are stored in a resource file (.resx in .NET) and you have created "satellite assemblies" that contain translated strings for other languages. You then need to ensure that ever string displayed to the user in your application uses the Resources APIs (or IDE-generated helper classes). This is painful because it means going from this in your *.aspx files...

<p>Hello, welcome. This is in English.</p>

...to this:

<p><%= Resources.WelcomeMessage %></p>

...or this (if you have too many strings to be managed by the Resources helper class):

<p><%= ResourceManager.GetString("HomePage_WelcomeMessage") %></p>

...doing this, of course, breaks any visual-designers for your website, for example.

Dai
  • 141,631
  • 28
  • 261
  • 374
  • 3
    Thank you very much for your reply. I knew that I need the resource files. What I had to change was uiculture="fr" to uiculture="fr-fr" – user664889 Feb 19 '13 at 10:49