Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CultureInfo.CurrentCulture is giving me the wrong culture

I'm trying to get my clients' country, so I use CultureInfo.CurrentCulture. Problem is that when my Canadian customers use my website, they're showing up as American.

It looks like CultureInfo.CurrentCulture is returning my server's country instead of their country. So how do I get my clients' country?

like image 562
thchaver Avatar asked Jun 28 '10 17:06

thchaver


1 Answers

In my case my machine originally had English - UK installed. I added the English - US language and set it as default. I also verified that US was set correctly in the registry. Sadly, System.Threading.Thread.CurrentThread.CurrentCulture still displayed the wrong culture, UK. I discovered you need to set the language options. Download the language pack, handwriting and speech.

Even then the culture was incorrect. The UK would show up all over the machine and after I installed the US language pack the start menu went completely nuts. I gave up and reinstalled the OS using an english-US version.

like image 57
P.Brian.Mackey Avatar answered Oct 21 '22 04:10

P.Brian.Mackey