9
9
using Umbraco . Cms . Core . Mapping ;
10
10
using Umbraco . Cms . Core . Models ;
11
11
using Umbraco . Cms . Core . Services ;
12
- using Umbraco . Cms . Web . BackOffice . Extensions ;
13
- using Umbraco . Cms . Web . Common . ActionsResults ;
14
12
using Umbraco . Cms . Web . Common . Attributes ;
15
13
using Umbraco . Cms . Web . Common . Authorization ;
16
14
using Umbraco . Extensions ;
@@ -23,7 +21,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
23
21
/// Backoffice controller supporting the dashboard for language administration.
24
22
/// </summary>
25
23
[ PluginController ( Constants . Web . Mvc . BackOfficeApiArea ) ]
26
- //[PrefixlessBodyModelValidator]
27
24
public class LanguageController : UmbracoAuthorizedJsonController
28
25
{
29
26
private readonly ILocalizationService _localizationService ;
@@ -51,10 +48,12 @@ public IDictionary<string, string> GetAllCultures()
51
48
// (see notes in Language class about culture info names)
52
49
// TODO: Fix this requirement, see https://github.com/umbraco/Umbraco-CMS/issues/3623
53
50
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 ) ;
58
57
}
59
58
60
59
/// <summary>
0 commit comments