CultureInfo.Unix.cs 985 B

123456789101112131415161718192021222324252627282930313233
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Globalization
  5. {
  6. public partial class CultureInfo : IFormatProvider
  7. {
  8. internal static CultureInfo GetUserDefaultCulture()
  9. {
  10. if (GlobalizationMode.Invariant)
  11. return CultureInfo.InvariantCulture;
  12. CultureInfo cultureInfo = null;
  13. string localeName;
  14. if (CultureData.GetDefaultLocaleName(out localeName))
  15. {
  16. cultureInfo = GetCultureByName(localeName);
  17. }
  18. else
  19. {
  20. cultureInfo = CultureInfo.InvariantCulture;
  21. }
  22. return cultureInfo;
  23. }
  24. private static CultureInfo GetUserDefaultUICulture()
  25. {
  26. return InitializeUserDefaultCulture();
  27. }
  28. }
  29. }