You are here

public function TokenAuthUser::getPreferredAdminLangcode in Simple OAuth (OAuth2) & OpenID Connect 8.3

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

Returns the preferred administrative language code of the account.

Defines which language is used on administrative pages.

Parameters

bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no administration language preference.

Return value

string The language code that is preferred by the account for administration pages. If the preferred language is not set or is a language not configured anymore on the site, the site default is returned or an empty string is returned (if $fallback_to_default is FALSE).

Overrides AccountInterface::getPreferredAdminLangcode

File

src/Authentication/TokenAuthUser.php, line 146

Class

TokenAuthUser
The decorated user class with token information.

Namespace

Drupal\simple_oauth\Authentication

Code

public function getPreferredAdminLangcode($fallback_to_default = TRUE) {
  return $this->subject
    ->getPreferredAdminLangcode($fallback_to_default);
}