You are here

protected static function ConfigurableLanguage::getDefaultLangcode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 189
Contains \Drupal\language\Entity\ConfigurableLanguage.

Class

ConfigurableLanguage
Defines the ConfigurableLanguage entity.

Namespace

Drupal\language\Entity

Code

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