How to create UIToolkit/UIElements menu for com.unity.localization package?

How to create UIToolkit/UIElements custom VisualElement menu for com.unity.localization package to switch between different Locale settings? (i.e. language, translation).

Ideally: a dropdown menu or a list that displays existing Locale entries only.

Notes:

You may want to place Player Pref Locale Selector close to the top of Localization Settings / Locale Selectors list.

Adjust minimum element height (style) to control list height:

Localization.LocaleList style="min-height: 100px;"
// void* src = https://gist.github.com/andrew-raphael-lukasik/e4ae9b45a2c24672c0d1218f77235948
using System.Collections.Generic;
using System.Linq;
  
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;
using UnityEngine.ResourceManagement.AsyncOperations;
  
namespace Localization
{
	public class LocaleList : VisualElement
	{
		#region fields
  
		const int k_itemHeight = 16;
		public int itemHeight { get; set; } = k_itemHeight;
		public List<Locale> locales = new List<Locale>();
		ListView listview = null;
  
		#endregion
		#region constructors
  
		public LocaleList ()
		{
			listview = new ListView(
				itemsSource:	locales ,
				itemHeight:		itemHeight ,
				makeItem:		OnMakeItem ,
				bindItem:		OnBindItem
			);
			listview.selectionType = SelectionType.Single;
			{
				var style = listview.style;
				style.minHeight = itemHeight;
				style.flexGrow = 1f;
			}
			this.Add( listview );
			listview.onItemsChosen += OnItemsChosen;
			// _listview.onSelectionChange += (objects)=> Debug.Log($"selection change: {objects}");
  
			if( Application.isPlaying )
			{
				var op = LocalizationSettings.SelectedLocaleAsync;
				if( op.IsDone ) InitializeCompleted( op );
				else op.Completed += InitializeCompleted;
			}
			else
			{
				locales.Add(null);
				locales.Add(null);
				locales.Add(null);
				listview.Refresh();
			}
		}
  
		#endregion
		#region private methods
  
		void InitializeCompleted ( AsyncOperationHandle<Locale> op )
		{
			locales.Clear();
			locales.AddRange( LocalizationSettings.AvailableLocales.Locales );
			listview.Refresh();
  
			LocalizationSettings.SelectedLocaleChanged += LocalizationSettings_SelectedLocaleChanged;
		}
  
		VisualElement OnMakeItem ()
		{
			return new Label();
		}
		void OnBindItem ( VisualElement visualElement , int index )
		{
			Label label = (Label) visualElement;
			Locale locale = locales[index];
			label.text = locale!=null ?  locale.name : "...";
		}
  
		void OnItemsChosen ( IEnumerable<object> objects ) => ChangeLocale( (Locale) objects.FirstOrDefault() );
		void ChangeLocale ( Locale locale )
		{
			if( locale!=null )
			{
				LocalizationSettings.SelectedLocaleChanged -= LocalizationSettings_SelectedLocaleChanged;
				LocalizationSettings.SelectedLocale = locale;
				LocalizationSettings.SelectedLocaleChanged += LocalizationSettings_SelectedLocaleChanged;
			}
			else Debug.LogWarning("locale object is null");
		}
  
		void LocalizationSettings_SelectedLocaleChanged ( Locale locale )
		{
			listview.ScrollToItem( locales.IndexOf(locale) );
		}
  
		#endregion
		#region nested types
  
		public new class UxmlFactory : UxmlFactory<LocaleList,UxmlTraits> {}
		public new class UxmlTraits : VisualElement.UxmlTraits
		{
			UxmlIntAttributeDescription itemHeightAttr = new UxmlIntAttributeDescription { name="item-height" , defaultValue=k_itemHeight };
			public override void Init ( VisualElement ve , IUxmlAttributes attributes , CreationContext context )
			{
				base.Init( ve , attributes , context );
				
				LocaleList instance = (LocaleList) ve;
				instance.itemHeight = itemHeightAttr.GetValueFromBag( attributes , context );
				instance.listview.itemHeight = instance.itemHeight;
			}
		}
		
		#endregion
	}
}