ConfigurableLanguageManager::getDefinedLanguageTypesInfo

public ConfigurableLanguageManager::getDefinedLanguageTypesInfo()

Returns information about all defined language types.

Defines the three core language types:

  • Interface language is the only configurable language type in core. It is used by t() as the default language if none is specified.
  • Content language is by default non-configurable and inherits the interface language negotiated value. It is used by the Field API to determine the display language for fields if no explicit value is specified.
  • URL language is by default non-configurable and is determined through the URL language negotiation method or the URL fallback language negotiation method if no language can be detected. It is used by l() as the default language if none is specified.

Return value

array An associative array of language type information arrays keyed by language type machine name, in the format of hook_language_types_info().

Overrides LanguageManager::getDefinedLanguageTypesInfo

File

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

Class

ConfigurableLanguageManager
Overrides default LanguageManager to provide configured languages.

Namespace

Drupal\language

Code

public function getDefinedLanguageTypesInfo() {
  if (!isset($this->languageTypesInfo)) {
    $defaults = parent::getDefinedLanguageTypesInfo();

    $info = $this->moduleHandler->invokeAll('language_types_info');
    $language_info = $info + $defaults;

    // Let other modules alter the list of language types.
    $this->moduleHandler->alter('language_types_info', $language_info);
    $this->languageTypesInfo = $language_info;
  }
  return $this->languageTypesInfo;
}
doc_Drupal
2016-10-29 08:55:15
Comments
Leave a Comment

Please login to continue.