about localization

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
 
J

Jason Keats

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
 
A

Arne Vajhøj

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top