Reputation: 3128
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?
Upvotes: 2
Views: 1811
Reputation: 13017
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.
Upvotes: 0
Reputation: 21
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.
Upvotes: 2
Reputation: 3128
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.
Upvotes: 0