You are here

protected function LanguageNegotiator::getEnabledNegotiators in Domain Lang 8

Gets enabled detection methods for the provided language type.

Parameters

string $type: The language type.

Return value

array An array of enabled detection methods for the provided language type.

Overrides LanguageNegotiator::getEnabledNegotiators

File

src/Language/LanguageNegotiator.php, line 16

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\domain_lang\Language

Code

protected function getEnabledNegotiators($type) {
  $domain = \Drupal::service('domain.negotiator')
    ->getActiveDomain();
  if ($domain instanceof DomainInterface) {
    return $this->configFactory
      ->get('domain.config.' . $domain
      ->id() . '.language.types')
      ->get('negotiation.' . $type . '.enabled') ?: [];
  }
  return parent::getEnabledNegotiators($type);
}