docs: private void initLanguageSwitch(Collection<Locale> locales, Locale current) {
  
          FormLayout languages = new FormLayout();
          languages.setHeight("100%");
          languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
          ComboBox languageSelect = new ComboBox();
          languageSelect.setCaption(m_messages.key(Messages.GUI_LANGUAGE_SWITCHER_LABEL_0));
          languageSelect.setNullSelectionAllowed(false);
  
          // set Locales
          for (Locale locale : locales) {
              languageSelect.addItem(locale);
              String caption = locale.getDisplayName(UI.getCurrent().getLocale());
              if (CmsLocaleManager.getDefaultLocale().equals(locale)) {
                  caption += " ("
                      + Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_DEFAULT_LOCALE_0)
                      + ")";
              }
              languageSelect.setItemCaption(locale, caption);
          }
          languageSelect.setValue(current);
          languageSelect.setNewItemsAllowed(false);
          languageSelect.setTextInputAllowed(false);
          languageSelect.addValueChangeListener(new ValueChangeListener() {
  
              private static final long serialVersionUID = 1L;
  
              public void valueChange(ValueChangeEvent event) {
  
                  m_listener.handleLanguageChange((Locale)event.getProperty().getValue());
  
              }
          });
  
          if (locales.size() == 1) {
              languageSelect.setEnabled(false);
          }
          languages.addComponent(languageSelect);
          m_languageSwitch = languages;
      }