0

I understand the difference between CurrentCulture and CurrentUICulture well. The question I have is why did we require two separate properties, one for things like Date,Current format and one for using the right resource file?

Is it ever going to be that my Date/Currency etc is set at a Japanese culture but my Resource file that is being used is of US-English?

I have a clue to the answer: may be CurrentCulture is for a broader class of language (e.g. en) and UICulture is for more specific variant of the language (like en-US) but am not sure if this is true.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Gaurav Karwal
  • 116
  • 2
  • 10
  • Not sure, but that question entails the difference, which is an assumption to my question. I know the diff, don't know why just one property would not have sufficed. – Gaurav Karwal Feb 02 '14 at 09:17
  • 2
    did you see the link in the answer? http://web.archive.org/web/20120129201452/http://blogs.msdn.com/b/michkap/archive/2007/01/11/1449754.aspx – Junaith Feb 02 '14 at 09:18
  • I always install all software in english so I get quick updates and patches, but I prefer dates and metrics to be in european format (dd/mm/yyyy). – pid Feb 02 '14 at 10:04
  • The first answer in the linked question provides an example when the values are different. Isn't that enough reasoning to have two properties? – Athari Feb 02 '14 at 10:34
  • Well, after reading all of it, my question still stands. What I understood so far is the best reason we can give to this ambiguity is "because windows is that way". @Athari: Yes, that answer gives a reason, but then why dont we have different properties to change the currency and datetime? I may even want to have a different datetime format than my currency format? Why is the UI given a special treatment? Which takes me back "because windows has it that way" – Gaurav Karwal Feb 02 '14 at 11:21
  • You can customize format of dates and currency. Both `CurrentCulture` and `CurrentUICulture` will include those user overrides. – Athari Feb 02 '14 at 11:54
  • @Athari are you saying even if my 'code'(CurrentCulture) is en-BR, I can still have a mismatch between date format and currency forma (assuming we have not explicitly mentioned a specific format to use) – Gaurav Karwal Feb 02 '14 at 13:05
  • See [CultureInfo constructor](http://msdn.microsoft.com/en-us/library/7h898a16(v=vs.110).aspx). If you set `useUserOverride` to `true`, user settings will override selected culture settings. This is how `CurrentCulture` and `CurrentUICulture` are created. And yes, cultures created that way can have any settings for date and number formatting, they are not guaranteed to be original settings from default culture. – Athari Feb 02 '14 at 15:21

1 Answers1

1

I have not read the answers on the provided links, but in my company we handle it like this: We only support 4 languages (EN, FR, DE and IT) but we support many more date and number formats. E.g. Switzerland writes numbers differently than germany. But the language itself is the same. So, for the language itself we use CurrentUICulture and for the formats we have CurrentCulture. Which we set to DE-DE or DE-CH. Therefore the two different culture settings are very helpful for us.

Remy
  • 12,555
  • 14
  • 64
  • 104