Skip to content

Commit

Permalink
Clarifying a comment
Browse files Browse the repository at this point in the history
+semver: major
  • Loading branch information
josephmyers committed May 20, 2024
1 parent 10f2fe1 commit dab88cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/L10NSharp/L10NCultureInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit dab88cd

Please sign in to comment.