mirror of
https://github.com/cyanfish/naps2.git
synced 2024-08-17 03:00:21 +03:00
Fix language dropdown on Mac/Linux
This commit is contained in:
parent
0f0a15c68f
commit
1c9ba2ab1f
@ -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))]
|
||||
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user