Avoid looking for en-US culture resources
This commit is contained in:
parent
468327d597
commit
52d1d5841e
|
@ -76,11 +76,16 @@ namespace Oqtane.Controllers
|
||||||
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
|
|
||||||
// Get the satellite assemblies
|
// Get the satellite assemblies
|
||||||
foreach (var cultureFolder in LocalizationSettings.SupportedCultures)
|
foreach (var culture in LocalizationSettings.SupportedCultures)
|
||||||
{
|
{
|
||||||
foreach (var resourceFile in Directory.EnumerateFiles(Path.Combine(Path.GetDirectoryName(binFolder), cultureFolder)))
|
if (culture == Constants.DefaultCulture)
|
||||||
{
|
{
|
||||||
list.Add(Path.Combine(cultureFolder, Path.GetFileNameWithoutExtension(resourceFile)));
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var resourceFile in Directory.EnumerateFiles(Path.Combine(Path.GetDirectoryName(binFolder), culture)))
|
||||||
|
{
|
||||||
|
list.Add(Path.Combine(culture, Path.GetFileNameWithoutExtension(resourceFile)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,11 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
|
|
||||||
foreach (var culture in LocalizationSettings.SupportedCultures)
|
foreach (var culture in LocalizationSettings.SupportedCultures)
|
||||||
{
|
{
|
||||||
|
if (culture == Constants.DefaultCulture)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var assembliesFolder = new DirectoryInfo(Path.Combine(assemblyPath, culture));
|
var assembliesFolder = new DirectoryInfo(Path.Combine(assemblyPath, culture));
|
||||||
foreach (var assemblyFile in assembliesFolder.EnumerateFiles(Constants.StalliteAssemblyExtension))
|
foreach (var assemblyFile in assembliesFolder.EnumerateFiles(Constants.StalliteAssemblyExtension))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Oqtane.Shared;
|
||||||
|
|
||||||
namespace Oqtane.Infrastructure.Localization
|
namespace Oqtane.Infrastructure.Localization
|
||||||
{
|
{
|
||||||
public static class LocalizationSettings
|
public static class LocalizationSettings
|
||||||
{
|
{
|
||||||
private const string EnglishCulture = "en-US";
|
|
||||||
|
|
||||||
static LocalizationSettings()
|
static LocalizationSettings()
|
||||||
{
|
{
|
||||||
DefaultCulture = EnglishCulture;
|
DefaultCulture = Constants.DefaultCulture;
|
||||||
SupportedCultures = new List<string> { DefaultCulture };
|
SupportedCultures = new List<string> { DefaultCulture };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,5 +59,7 @@ namespace Oqtane.Shared
|
||||||
public static readonly string[] InvalidFileNameEndingChars = { ".", " " };
|
public static readonly string[] InvalidFileNameEndingChars = { ".", " " };
|
||||||
|
|
||||||
public static readonly string StalliteAssemblyExtension = ".resources.dll";
|
public static readonly string StalliteAssemblyExtension = ".resources.dll";
|
||||||
|
|
||||||
|
public static readonly string DefaultCulture = "en-US";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user