You are here

public function TokenAuthUser::getTranslation in Simple OAuth (OAuth2) & OpenID Connect 8

Same name and namespace in other branches
  1. 8.4 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getTranslation()
  2. 8.2 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getTranslation()
  3. 8.3 src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getTranslation()
  4. 5.x src/Authentication/TokenAuthUser.php \Drupal\simple_oauth\Authentication\TokenAuthUser::getTranslation()

Gets a translation of the data.

The returned translation has to be of the same type than this typed data object.

Parameters

$langcode: The language code of the translation to get or LanguageInterface::LANGCODE_DEFAULT to get the data in default language.

Return value

$this A typed data object for the translated data.

Throws

\InvalidArgumentException If an invalid or non-existing translation language is specified.

Overrides TranslatableInterface::getTranslation

File

src/Authentication/TokenAuthUser.php, line 633

Class

TokenAuthUser
Class TokenAuthUser.

Namespace

Drupal\simple_oauth\Authentication

Code

public function getTranslation($langcode) {
  return $this->subject
    ->getTranslation($langcode);
}