2

I just found out today that WPF will ignore CultureInfo.CurrentCulture and always use en-US. I have also found a wonderful answer here. Everything worked fine until one of the users customized the regional settings to change the currency symbol (here in the Philippines you could write Php and P and most people prefer P, the default setting is Php). The application doesn't seem to pick this up. Is there any way around this?

Community
  • 1
  • 1
Mel
  • 3,058
  • 4
  • 26
  • 40
  • Someone wrote a replacement for the default Bindings which sets the ConverterCulture as you would expect it: http://wpfglue.wordpress.com/2010/01/14/localized-value-formatting-in-wpf/ – Daniel Hilgarth Mar 15 '11 at 09:33
  • 2
    Not relevant to the question, but the geek in me finds the statement "Php is the default in the Philippines" funny :) – Jon Mar 15 '11 at 09:36
  • Same problem exactly! Anyone has answer? – yossharel Mar 15 '11 at 15:34

3 Answers3

2

I recently had to check for the current country setup for my C# WPF application. I used CurrentCulture and not CurrentUICulture (which picked up EN-US for me too).

Also, I'm not sure this will help- but I found out I was testing this functionality in the wrong place.

To change the country of your app for testing go to: “Control Panel->Clock, Language, and Region” select the “Region and Language” button, a window will pop up, go to the format tab, change the country in the format listbox.

Once I did that CurrentCulture worked fine.

CiaraMulv
  • 21
  • 2
0

Yes, there is a way to make WPF use customized regional settings, but you need to force all bindings to use CultureInfo.CurrentCulture. See this post for examples.

Community
  • 1
  • 1
Sphinxxx
  • 12,484
  • 4
  • 54
  • 84
0

Well after a week's research of two people, I think there is currently no way of doing this using the Globalization classes.

CurrentUICulture and other related classes contain the default formats/settings for the selected Language but not the customized settings.

One way to do this is by reading the values straight from the registry key, HKCU\Control Panel\International.

Mel
  • 3,058
  • 4
  • 26
  • 40