Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContentTranslationHandler.php

function ContentTranslationHandler::getSourceLangcode

Overrides ContentTranslationHandlerInterface::getSourceLangcode

2 calls to ContentTranslationHandler::getSourceLangcode()
ProfileTranslationHandler::entityFormSave in core/modules/user/src/ProfileTranslationHandler.php
Form submission handler for ProfileTranslationHandler::entityFormAlter().
TermTranslationHandler::entityFormSave in core/modules/taxonomy/src/TermTranslationHandler.php
Form submission handler for TermTranslationHandler::entityFormAlter().

File

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

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal