about localization

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!

I just wonder what is the point to have both a CurrentCulture and a
CurrentUICulture because these are always the same.
I mean it would be enought with one. Can somebode explain why these two must
exist.?

System.Globalization.CultureInfo ci = new
System.Globalization.CultureInfo("es-ES");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

//Tony
 
Tony said:
Hello!

I just wonder what is the point to have both a CurrentCulture and a
CurrentUICulture because these are always the same.
I mean it would be enought with one. Can somebode explain why these two must
exist.?

System.Globalization.CultureInfo ci = new
System.Globalization.CultureInfo("es-ES");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

http://www.google.com/search?q=currentculture+currentuiculture
 
I just wonder what is the point to have both a CurrentCulture and a
CurrentUICulture because these are always the same.
I mean it would be enought with one. Can somebode explain why these two must
exist.?

System.Globalization.CultureInfo ci = new
System.Globalization.CultureInfo("es-ES");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

They are often the same but not always.

CurrentCulture is what your app is using internally.

CurrentUICulture is what is used to present to the user.

Let us say that you have a web app that presents some
data that you get uploaded by an admin as XML.

It makes sense to have the app run with CurrentCulture
English so that the XML get parse assuming . not , as
decimal separator, but allow the user to chose whether
to read text in English or Swedish so CurrentUICulture
would be either English or Swedish.

Maybe not the worlds best example, but it was the best
I could come up with.

Arne
 
Back
Top