mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-31 21:32:56 +08:00
Merge pull request #6280 from jtkech/patch-5
Little update to FrontEndCultureSelector.cshtml
This commit is contained in:
commit
f09a7d999e
@ -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>
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user