Chris@0: getDefinedLanguageTypesInfo(); Chris@0: $configurable_types = $language_manager->getLanguageTypes(); Chris@0: foreach ($configurable_types as $type) { Chris@0: $this->derivatives[$type] = $base_plugin_definition; Chris@0: $this->derivatives[$type]['admin_label'] = t('Language switcher (@type)', ['@type' => $info[$type]['name']]); Chris@0: } Chris@0: // If there is just one configurable type then change the title of the Chris@0: // block. Chris@0: if (count($configurable_types) == 1) { Chris@0: $this->derivatives[reset($configurable_types)]['admin_label'] = t('Language switcher'); Chris@0: } Chris@0: } Chris@0: Chris@0: return parent::getDerivativeDefinitions($base_plugin_definition); Chris@0: } Chris@0: Chris@0: }