mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Update FrontEndCultureSelector.cshtml
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
var localizableAspects = Enumerable.Empty<ILocalizableAspect>();
|
||||
var homePage = WorkContext.Resolve<IHomeAliasService>().GetHomePage();
|
||||
|
||||
if (homePage != null) {
|
||||
if (homePage != null && homePage.Has<ILocalizableAspect>()) {
|
||||
var localizationService = WorkContext.Resolve<ILocalizationService>();
|
||||
localizableAspects = localizationService.GetLocalizations(homePage).Concat(new[] { homePage.As<ILocalizableAspect>() });
|
||||
}
|
||||
@@ -16,6 +16,11 @@
|
||||
<div>
|
||||
<ul>
|
||||
@foreach (var localization in localizableAspects) {
|
||||
|
||||
if (localization.Culture == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var culture = CultureInfo.GetCultureInfo(localization.Culture);
|
||||
|
||||
<li>
|
||||
@@ -29,4 +34,4 @@
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user