From 82b85ab24db245a3fca98e0d59c502e313c11799 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Sun, 18 Apr 2021 11:51:33 -0400 Subject: [PATCH] optimize GetSupportedCultures --- Oqtane.Server/Infrastructure/LocalizationManager.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Oqtane.Server/Infrastructure/LocalizationManager.cs b/Oqtane.Server/Infrastructure/LocalizationManager.cs index d52bda8f..1ec6e740 100644 --- a/Oqtane.Server/Infrastructure/LocalizationManager.cs +++ b/Oqtane.Server/Infrastructure/LocalizationManager.cs @@ -26,12 +26,9 @@ namespace Oqtane.Infrastructure public string[] GetSupportedCultures() { List cultures = new List(); - foreach(var file in Directory.EnumerateFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "*.resources.dll", SearchOption.AllDirectories)) + foreach(var file in Directory.EnumerateFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Oqtane.Client.resources.dll", SearchOption.AllDirectories)) { - if (!cultures.Contains(Path.GetFileName(Path.GetDirectoryName(file)))) - { - cultures.Add(Path.GetFileName(Path.GetDirectoryName(file))); - } + cultures.Add(Path.GetFileName(Path.GetDirectoryName(file))); } if (cultures.Count == 0) {