function LanguageManager::getDefaultLockedLanguages

Same name in other branches
  1. 9 core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getDefaultLockedLanguages()
  2. 8.9.x core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getDefaultLockedLanguages()
  3. 11.x core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getDefaultLockedLanguages()
2 calls to LanguageManager::getDefaultLockedLanguages()
ConfigurableLanguageManager::getLanguages in core/modules/language/src/ConfigurableLanguageManager.php
LanguageManager::getLanguages in core/lib/Drupal/Core/Language/LanguageManager.php

File

core/lib/Drupal/Core/Language/LanguageManager.php, line 179

Class

LanguageManager
Class responsible for providing language support on language-unaware sites.

Namespace

Drupal\Core\Language

Code

public function getDefaultLockedLanguages($weight = 0) {
    $languages = [];
    $locked_language = [
        'default' => FALSE,
        'locked' => TRUE,
        'direction' => LanguageInterface::DIRECTION_LTR,
    ];
    // This is called very early while initializing the language system. Prevent
    // early t() calls by using the TranslatableMarkup.
    $languages[LanguageInterface::LANGCODE_NOT_SPECIFIED] = new Language([
        'id' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
        'name' => new TranslatableMarkup('Not specified'),
        'weight' => ++$weight,
    ] + $locked_language);
    $languages[LanguageInterface::LANGCODE_NOT_APPLICABLE] = new Language([
        'id' => LanguageInterface::LANGCODE_NOT_APPLICABLE,
        'name' => new TranslatableMarkup('Not applicable'),
        'weight' => ++$weight,
    ] + $locked_language);
    return $languages;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.