You are here

public function ConfigurableLanguageManager::getNegotiatedLanguageMethod in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::getNegotiatedLanguageMethod()

Gets the negotiated language method ID.

Parameters

string $type: (optional) The language type; e.g., the interface or the content language.

Return value

string The negotiated language method ID.

Overrides ConfigurableLanguageManagerInterface::getNegotiatedLanguageMethod

File

core/modules/language/src/ConfigurableLanguageManager.php, line 482

Class

ConfigurableLanguageManager
Overrides default LanguageManager to provide configured languages.

Namespace

Drupal\language

Code

public function getNegotiatedLanguageMethod($type = LanguageInterface::TYPE_INTERFACE) {
  if (isset($this->negotiatedLanguages[$type]) && isset($this->negotiatedMethods[$type])) {
    return $this->negotiatedMethods[$type];
  }
}