You are here

public function EntityTranslationDefaultHandler::setActiveLanguage in Entity Translation 7

Sets the active language.

This is the language that determines which translation should be considered "active" for the wrapped entity. The "Entity Translation" module uses this information to implement the UI-based translation workflow. Other modules can rely on it to implement their own entity translation-related logic.

This will affect which language is returned by the core "entity_language()" function.

Parameters

string $langcode: The active language code.

Overrides EntityTranslationHandlerInterface::setActiveLanguage

See also

entity_language()

entity_translation_language()

::getActiveLanguage()

1 call to EntityTranslationDefaultHandler::setActiveLanguage()
EntityTranslationDefaultHandler::updateFormLanguage in includes/translation.handler.inc
Update the current form language based on the submitted value.

File

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

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

public function setActiveLanguage($langcode) {

  // @todo To fully preserve BC, we proxy the call to the deprecated
  //   ::setFormLanguage method. This will keep things working even when it
  //   has been overridden. Inline its implementation here upon removal.
  $this
    ->setFormLanguage($langcode);
}