Difference between CurrentCulture, InvariantCulture, CurrentUICulture and InstalledUICulture

前端 未结 2 1541
余生分开走
余生分开走 2020-12-02 06:00

What is the difference between CurrentCulture, InvariantCulture, CurrentUICulture and InstalledUICulture from Syste

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 06:38

    Taken from this answer:

    CurrentCulture is the .NET representation of the default user locale of the system. This controls default number and date formatting and the like.

    CurrentUICulture refers to the default user interface language, a setting introduced in Windows 2000. This is primarily regarding the UI localization/translation part of your app.

    Whatever regional options the system is configured to have will be the "Current" values in your .NET app.

    Often times they are both the same. But on my system they would be different: I prefer my numbers and dates in the German format, so the CurrentCulture would be German, but I also prefer all my applications in English, so the CurrentUICulture would be English.

提交回复
热议问题