Skip to content

Commit 3536863

Browse files
committed
Merge branch 'v9/9.0' into v9/dev
2 parents 109487f + 3cd09a8 commit 3536863

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Umbraco.Web.BackOffice/Controllers/LanguageController.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using Umbraco.Cms.Core.Mapping;
1010
using Umbraco.Cms.Core.Models;
1111
using Umbraco.Cms.Core.Services;
12-
using Umbraco.Cms.Web.BackOffice.Extensions;
13-
using Umbraco.Cms.Web.Common.ActionsResults;
1412
using Umbraco.Cms.Web.Common.Attributes;
1513
using Umbraco.Cms.Web.Common.Authorization;
1614
using Umbraco.Extensions;
@@ -23,7 +21,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
2321
/// Backoffice controller supporting the dashboard for language administration.
2422
/// </summary>
2523
[PluginController(Constants.Web.Mvc.BackOfficeApiArea)]
26-
//[PrefixlessBodyModelValidator]
2724
public class LanguageController : UmbracoAuthorizedJsonController
2825
{
2926
private readonly ILocalizationService _localizationService;
@@ -51,10 +48,12 @@ public IDictionary<string, string> GetAllCultures()
5148
// (see notes in Language class about culture info names)
5249
// TODO: Fix this requirement, see https://github.com/umbraco/Umbraco-CMS/issues/3623
5350
return CultureInfo.GetCultures(CultureTypes.AllCultures)
54-
.Where(x => !x.Name.IsNullOrWhiteSpace())
55-
.Select(x => new CultureInfo(x.Name)) // important!
56-
.OrderBy(x => x.EnglishName)
57-
.ToDictionary(x => x.Name, x => x.EnglishName);
51+
.Select(x=>x.Name)
52+
.Distinct()
53+
.Where(x => !x.IsNullOrWhiteSpace())
54+
.Select(x => new CultureInfo(x)) // important!
55+
.OrderBy(x => x.EnglishName)
56+
.ToDictionary(x => x.Name, x => x.EnglishName);
5857
}
5958

6059
/// <summary>

0 commit comments

Comments
 (0)