You are here

public function ContentTranslationHandler::getSourceLangcode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::getSourceLangcode()
  2. 9 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::getSourceLangcode()

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 306

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

public function getSourceLangcode(FormStateInterface $form_state) {
  if ($source = $form_state
    ->get([
    'content_translation',
    'source',
  ])) {
    return $source
      ->getId();
  }
  return FALSE;
}