CultureInfo.Unix.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. using System.Diagnostics;
  5. namespace System.Globalization
  6. {
  7. public partial class CultureInfo : IFormatProvider
  8. {
  9. internal static CultureInfo GetUserDefaultCulture()
  10. {
  11. if (GlobalizationMode.Invariant)
  12. return CultureInfo.InvariantCulture;
  13. CultureInfo cultureInfo;
  14. string? localeName;
  15. if (CultureData.GetDefaultLocaleName(out localeName))
  16. {
  17. Debug.Assert(localeName != null);
  18. cultureInfo = GetCultureByName(localeName);
  19. }
  20. else
  21. {
  22. cultureInfo = CultureInfo.InvariantCulture;
  23. }
  24. return cultureInfo;
  25. }
  26. private static CultureInfo GetUserDefaultUICulture()
  27. {
  28. return InitializeUserDefaultCulture();
  29. }
  30. }
  31. }