optimize satellite assembly loading based on the new model where all cultures are available

This commit is contained in:
Shaun Walker
2022-07-21 16:02:23 -04:00
parent d05fba06ec
commit 6bfab696ad
5 changed files with 47 additions and 72 deletions

View File

@ -22,11 +22,15 @@ namespace Oqtane.Controllers
// GET: api/localization
[HttpGet()]
public IEnumerable<Culture> Get()
=> _localizationManager.GetSupportedCultures().Select(c => new Culture {
Name = CultureInfo.GetCultureInfo(c).Name,
DisplayName = CultureInfo.GetCultureInfo(c).DisplayName,
IsDefault = _localizationManager.GetDefaultCulture()
{
var cultures = _localizationManager.GetSupportedCultures().Select(c => new Culture
{
Name = CultureInfo.GetCultureInfo(c).Name,
DisplayName = CultureInfo.GetCultureInfo(c).DisplayName,
IsDefault = _localizationManager.GetDefaultCulture()
.Equals(CultureInfo.GetCultureInfo(c).Name, StringComparison.OrdinalIgnoreCase)
});
});
return cultures.OrderBy(item => item.DisplayName);
}
}
}