public function LanguageBlock::getDerivativeDefinitions

Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions().

Overrides DerivativeInterface::getDerivativeDefinitions

1 call to LanguageBlock::getDerivativeDefinitions()

File

drupal/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php, line 38
Contains \Drupal\language\Plugin\Derivative\LanguageBlock.

Class

LanguageBlock
Provides language switcher block plugin definitions for all languages.

Namespace

Drupal\language\Plugin\Derivative

Code

public function getDerivativeDefinitions(array $base_plugin_definition) {
  include_once DRUPAL_ROOT . '/core/includes/language.inc';
  $info = language_types_info();
  foreach (language_types_get_configurable(FALSE) as $type) {
    $this->derivatives[$type] = $base_plugin_definition;
    $this->derivatives[$type]['admin_label'] = t('Language switcher (!type)', array(
      '!type' => $info[$type]['name'],
    ));
    $this->derivatives[$type]['cache'] = DRUPAL_NO_CACHE;
  }
  return $this->derivatives;
}