introducing Site Groups

This commit is contained in:
sbwalker
2026-01-27 16:51:30 -05:00
parent 6006e6f63c
commit 3be2b9c720
51 changed files with 2558 additions and 352 deletions

View File

@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Oqtane.Extensions;
using Oqtane.Infrastructure;
using Oqtane.Models;
using Oqtane.Repository;
using Oqtane.Shared;
namespace Oqtane.Controllers
@@ -13,10 +15,16 @@ namespace Oqtane.Controllers
public class LocalizationController : Controller
{
private readonly ILocalizationManager _localizationManager;
private readonly ISiteRepository _siteRepository;
private readonly ISiteGroupRepository _siteGroupRepository;
private readonly IAliasRepository _aliasRepository;
public LocalizationController(ILocalizationManager localizationManager)
public LocalizationController(ILocalizationManager localizationManager, ISiteRepository siteRepository, ISiteGroupRepository siteGroupRepository, IAliasRepository aliasRepository)
{
_localizationManager = localizationManager;
_siteRepository = siteRepository;
_siteGroupRepository = siteGroupRepository;
_aliasRepository = aliasRepository;
}
// GET: api/localization
@@ -32,13 +40,20 @@ namespace Oqtane.Controllers
{
culturecodes = _localizationManager.GetSupportedCultures();
}
var cultures = culturecodes.Select(c => new Culture
{
Name = CultureInfo.GetCultureInfo(c).Name,
DisplayName = CultureInfo.GetCultureInfo(c).DisplayName,
IsDefault = _localizationManager.GetDefaultCulture()
.Equals(CultureInfo.GetCultureInfo(c).Name, StringComparison.OrdinalIgnoreCase)
});
}).ToList();
if (cultures.Count == 0)
{
cultures.Add(new Culture { Name = "en", DisplayName = "English", IsDefault = true });
}
return cultures.OrderBy(item => item.DisplayName);
}
}