disableLanguageSwitcher example

// Update the language negotiations after setting the configurability.     foreach ($method_weights_type as $type => $method_weights) {
      $this->negotiator->saveConfiguration($type$method_weights);
    }

    // Clear block definitions cache since the available blocks and their names     // may have been changed based on the configurable types.     if ($this->blockStorage) {
      // If there is an active language switcher for a language type that has       // been made not configurable, deactivate it first.       $non_configurable = array_keys(array_diff($customizedarray_filter($customized)));
      $this->disableLanguageSwitcher($non_configurable);
    }
    $this->blockManager->clearCachedDefinitions();

    $form_state->setRedirect('language.negotiation');
    $this->messenger()->addStatus($this->t('Language detection configuration saved.'));
  }

  /** * Builds a language negotiation method configuration table. * * @param array $form * The language negotiation configuration form. * @param string $type * The language type to generate the table for. */
Home | Imprint | This part of the site doesn't use cookies.