Fix language dropdown on Mac/Linux

This commit is contained in:
Ben Olden-Cooligan 2023-12-16 21:46:21 -08:00
parent 0f0a15c68f
commit 1c9ba2ab1f
2 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,7 @@ namespace NAPS2.App.Tests.Appium;
[Collection("appium")]
public class LanguageSelectionTests : AppiumTests
{
private static readonly HashSet<string> ExpectedMissingLanguages = ["bn", "hi", "id", "th", "ur"];
private static readonly HashSet<string> ExpectedMissingLanguages = ["bn", "ur"];
[VerifyTheory(AllowDebug = true, WindowsAppium = true)]
[ClassData(typeof(AppiumTestData))]

View File

@ -54,6 +54,12 @@ public class CultureHelper
public IEnumerable<(string langCode, string langName)> GetAvailableCultures()
{
#if NET6_0_OR_GREATER
// For self-contained builds we don't have separate DLL files we can check for existence
// TODO: Don't want to hard code this... it defeats the whole purpose of autodetection
var exclude = new HashSet<string> { "bn", "ur" };
return GetAllCultures().Where(x => !exclude.Contains(x.langCode));
#else
foreach (var (langCode, langName) in GetAllCultures())
{
// Only include those languages for which localized resources exist
@ -65,5 +71,6 @@ public class CultureHelper
yield return (langCode, langName);
}
}
#endif
}
}