You are here

protected static function ConfigurableLanguage::getDefaultLangcode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/language/src/Entity/ConfigurableLanguage.php \Drupal\language\Entity\ConfigurableLanguage::getDefaultLangcode()
  2. 9 core/modules/language/src/Entity/ConfigurableLanguage.php \Drupal\language\Entity\ConfigurableLanguage::getDefaultLangcode()

Gets the default langcode.

Return value

string The current default langcode.

2 calls to ConfigurableLanguage::getDefaultLangcode()
ConfigurableLanguage::isDefault in core/modules/language/src/Entity/ConfigurableLanguage.php
Returns whether this language is the default language.
ConfigurableLanguage::preDelete in core/modules/language/src/Entity/ConfigurableLanguage.php

File

core/modules/language/src/Entity/ConfigurableLanguage.php, line 212

Class

ConfigurableLanguage
Defines the ConfigurableLanguage entity.

Namespace

Drupal\language\Entity

Code

protected static function getDefaultLangcode() {
  $language = \Drupal::service('language.default')
    ->get();
  return $language
    ->getId();
}