You are here

public function EntityTranslationDefaultHandler::initTranslations in Entity Translation 7

Overrides EntityTranslationHandlerInterface::initTranslations

See also

EntityTranslationHandlerInterface::initTranslations()

1 call to EntityTranslationDefaultHandler::initTranslations()
EntityTranslationDefaultHandler::updateTranslations in includes/translation.handler.inc

File

includes/translation.handler.inc, line 763
Default translation handler for the translation module.

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

public function initTranslations() {
  $langcode = $this
    ->getLanguage();
  if (!empty($langcode)) {
    $translation = array(
      'language' => $langcode,
      'status' => 1,
    );
    $this
      ->setTranslation($translation);
    $this
      ->setOriginalLanguage($langcode);
  }
}