You are here

public function EntityTranslationDefaultHandler::getFormLanguage in Entity Translation 7

Retrieves the active form language.

Return value

string The active form language code.

Overrides EntityTranslationHandlerInterface::getFormLanguage

Deprecated

in 7.x-1.0-beta6, will be removed before 7.x-1.0. Use ::getActiveLanguage() instead.

See also

::getActiveLanguage()

1 call to EntityTranslationDefaultHandler::getFormLanguage()
EntityTranslationDefaultHandler::getActiveLanguage in includes/translation.handler.inc
Returns the active language.

File

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

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

public function getFormLanguage() {
  if (!empty($this->activeLanguage)) {
    return $this->activeLanguage;
  }
  elseif ($this
    ->isNewEntity()) {
    return $this
      ->getDefaultLanguage();
  }
  else {
    return $this
      ->getLanguage();
  }
}