You are here

public function ContentEntityForm::getFormLangcode in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::getFormLangcode()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::getFormLangcode()

Gets the code identifying the active form language.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

string The form language code.

Overrides ContentEntityFormInterface::getFormLangcode

1 call to ContentEntityForm::getFormLangcode()
ContentEntityForm::init in core/lib/Drupal/Core/Entity/ContentEntityForm.php
Initializes the form state and the entity before the first form build.

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 316

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

public function getFormLangcode(FormStateInterface $form_state) {
  $this
    ->initFormLangcodes($form_state);
  return $form_state
    ->get('langcode');
}