From dab88cd900e18eee3eacba5d6568617aecc90569 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 20 May 2024 12:01:19 +0700 Subject: [PATCH] Clarifying a comment +semver: major --- src/L10NSharp/L10NCultureInfo.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/L10NSharp/L10NCultureInfo.cs b/src/L10NSharp/L10NCultureInfo.cs index 454e2c0..1c807c8 100644 --- a/src/L10NSharp/L10NCultureInfo.cs +++ b/src/L10NSharp/L10NCultureInfo.cs @@ -35,10 +35,11 @@ public L10NCultureInfo(string name) RawCultureInfo = null; } - // Starting with Windows 10, unknown cultures no longer return a RawCultureInfo containing an "Unknown Language" indication. - // The proper way to detect fully unknown cultures, for Windows 10 and prior, is to: + // Windows 10 changed the behavior of CultureInfo, in that unknown cultures no longer return a RawCultureInfo containing an "Unknown Language" indication. + // The proper way to detect fully unknown cultures (for Windows 10 and prior) is to: // 1. Check for the custom culture flag // 2. Check if the three-letter language name is set to default + // Source: https://stackoverflow.com/a/71388328/1964319 var isFullyUnknown = RawCultureInfo.CultureTypes.HasFlag(CultureTypes.UserCustomCulture) && RawCultureInfo.ThreeLetterWindowsLanguageName == "ZZZ"; if (RawCultureInfo == null || isFullyUnknown) {