Skip to content

Commit 7167047

Browse files
committed
Add PredefinedOnly to Windows
1 parent df4d910 commit 7167047

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.Unix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal static partial class GlobalizationMode
1111

1212
internal static bool UseNls => false;
1313

14-
internal static bool PredefinedOnly { get; } = GetSwitchValue("System.Globalization.PredefinedOnly", "DOTNET_SYSTEM_GLOBALIZATION_PREDEFINED_ONLY");
14+
internal static bool PredefinedOnly { get; } = GetPredefinedOnly();
1515

1616
private static bool GetGlobalizationInvariantMode()
1717
{

src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.Windows.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ internal static partial class GlobalizationMode
99
// So we need Invariant to be initialized first.
1010
internal static bool Invariant { get; } = GetInvariantSwitchValue();
1111

12+
internal static bool PredefinedOnly { get; } = GetPredefinedOnly();
13+
1214
internal static bool UseNls { get; } = !Invariant &&
1315
(GetSwitchValue("System.Globalization.UseNls", "DOTNET_SYSTEM_GLOBALIZATION_USENLS") ||
1416
!LoadIcu());

src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ private static bool GetInvariantSwitchValue() =>
1414
private static bool TryGetAppLocalIcuSwitchValue([NotNullWhen(true)] out string? value) =>
1515
TryGetStringValue("System.Globalization.AppLocalIcu", "DOTNET_SYSTEM_GLOBALIZATION_APPLOCALICU", out value);
1616

17+
internal static bool GetPredefinedOnly() =>
18+
GetSwitchValue("System.Globalization.PredefinedOnly", "DOTNET_SYSTEM_GLOBALIZATION_PREDEFINED_ONLY");
19+
1720
private static bool GetSwitchValue(string switchName, string envVariable)
1821
{
1922
if (!AppContext.TryGetSwitch(switchName, out bool ret))

0 commit comments

Comments
 (0)