code: void switchLocale(final String locale) {
  
          if (locale.equals(m_locale)) {
              return;
          }
          m_locale = locale;
          m_basePanel.clear();
          destroyForm(false);
          final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
          m_entityId = getIdForLocale(locale);
          // if the content does not contain the requested locale yet, a new node will be created
          final boolean addedNewLocale = !m_contentLocales.contains(locale);
          if (m_registeredEntities.contains(m_entityId)) {
              unregistereEntity(m_entityId);
          }
          if (addedNewLocale) {
              loadNewDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {
  
                  public void execute(final CmsContentDefinition contentDefinition) {
  
                      setContentDefinition(contentDefinition);
                      renderFormContent();
                      setChanged();
  
                  }
              });
          } else {
              loadDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {
  
                  public void execute(CmsContentDefinition contentDefinition) {
  
                      setContentDefinition(contentDefinition);
                      renderFormContent();
                  }
              });
          }
      }
docs: Switches to the selected locale. Will save changes first.<p>
  
  @param locale the locale to switch to