Skip to main content
1 of 2
Dan Solovay
  • 2.2k
  • 18
  • 31

You can use LanguageComparer to apply this ordering:

var sortedLangauges = contextItem.Database.GetLanguages.OrderBy((x => x),new LanguageComparer(currentItem.Database));'

This is what the ContextEditor.SortLangauges setting uses behind the scenes.

Dan Solovay
  • 2.2k
  • 18
  • 31