U4-11368 - When adding supported languages, the dropdown list is sorted by country code instead of being sorted by name.

Created by simone chiaretta 25 May 2018, 14:13:27 Updated by Shannon Deminick 30 May 2018, 06:03:34

If you want to add a language to the list of languages supported by an instance, the dropdown menu is sorted by country code, while it should be sorted by name. For example, Latvian should appear after Latin, while it appears at the end of the "L" since it's country code is LV.

Comments

simone chiaretta 25 May 2018, 14:13:50

The issue was that the web API was returning a dictionary that was interpreted as data object by AngularJS, with each key becoming a property of an enormous object, so when binding this object to the select element, it was sorted by property name, thus the key of the array, which was the culture identifier, an being an object it was impossible to sort it again by value. Only option was to convert it to an array. And since the original list of culture is already sorted correctly, no need to sort it again.

Other options for fixing the issue would be to change the response returned by the WebAPI from IDictionary to a IList where something is just name and display name, and then there would be no need to convert the result in angularjs (but still the binding to the options would need to be changed)

PR: https://github.com/umbraco/Umbraco-CMS/pull/2645


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Easy

Category: UI

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 8.0.0

Due in version: 8.0.0

Sprint:

Story Points:

Cycle: