diff --git a/Modules/GenHTTP.Modules.I18n/Parsers/CultureInfoParser.cs b/Modules/GenHTTP.Modules.I18n/Parsers/CultureInfoParser.cs index 7a620110..9e5460ad 100644 --- a/Modules/GenHTTP.Modules.I18n/Parsers/CultureInfoParser.cs +++ b/Modules/GenHTTP.Modules.I18n/Parsers/CultureInfoParser.cs @@ -116,8 +116,12 @@ public static CultureInfo[] ParseFromLanguage(string? language) } try - { - results.Add(CultureInfo.CreateSpecificCulture(lang)); + { + var parsed = CultureInfo.CreateSpecificCulture(lang); + if (parsed.LCID != CultureInfo.InvariantCulture.LCID) + { + results.Add(parsed); + } } catch (CultureNotFoundException) { diff --git a/Testing/Acceptance/Modules/I18n/LanguageParserTests.cs b/Testing/Acceptance/Modules/I18n/LanguageParserTests.cs index 43069ef6..d22c1dec 100644 --- a/Testing/Acceptance/Modules/I18n/LanguageParserTests.cs +++ b/Testing/Acceptance/Modules/I18n/LanguageParserTests.cs @@ -58,6 +58,7 @@ public sealed class LanguageParserTests new ("en ;q=0.9,fr;q=0.8,de", [Culture("de"), Culture("en"), Culture("fr")]), new ("en; q=0.9 , fr; q= 0.8, de", [Culture("de"), Culture("en"), Culture("fr")]), new ("en-UK;q=0.9,fr;q=0.8,de", [Culture("de"), Culture("en-uk"), Culture("fr")]), + new ("en-UK;q=0.9,ww;q=0.8,de", [Culture("de"), Culture("en-uk")]), ]; [TestMethod]