locked
whats the difference between these statements? RRS feed

  • Question

  • User834589150 posted

    <Assembly: NeutralResourcesLanguageAttribute("fr", UltimateResourceFallbackLocation.Satellite)>

                    and

    Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr")

    both will set the default culture as FR...so what is the difference..can anyone explain ..

     

    THNX

     

    Monday, April 3, 2006 6:03 AM

All replies

  • User-527054664 posted

    <Assembly: NeutralResourcesLanguageAttribute("fr", UltimateResourceFallbackLocation.Satellite)>
    Here you are specifying that the assembly's default language is French.

    Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr")
    Here you are specifying that the current thread's culture is French.

    The end result is the same, really.  In the second example, if you set your CurrentUICulture to the default language (I think that's right) after setting it to French, it would change back to whatever the default language is for the assembly (usually English... silly Americans). 

    In the first example, however, you've overriden the default language and said that it should be French.

    Monday, April 10, 2006 9:55 PM
  • User1183903743 posted

    both will set the default culture as FR...so what is the difference..
    No!

    <Assembly: NeutralResourcesLanguageAttribute("fr", UltimateResourceFallbackLocation.Satellite)>

    only deals with the default. If a user's culture is not supported it would default to French and not invariant.

    The other statement deals with the current culture. CURRENT IS NOT DEFAULT.

    HTH

     

     

     

    Wednesday, April 12, 2006 1:35 PM