public ContentTranslationHandler::getSourceLangcode(FormStateInterface $form_state)
Retrieves the source language for the translation being created.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
string The source language code.
Overrides ContentTranslationHandlerInterface::getSourceLangcode
File
- core/modules/content_translation/src/ContentTranslationHandler.php, line 256
Class
- ContentTranslationHandler
- Base class for content translation handlers.
Namespace
Drupal\content_translation
Code
1 2 3 4 5 6 | public function getSourceLangcode(FormStateInterface $form_state ) { if ( $source = $form_state ->get([ 'content_translation' , 'source' ])) { return $source ->getId(); } return FALSE; } |
Please login to continue.