You are here

public function AccountProxy::getPreferredAdminLangcode in Restrict Login or Role Access by IP Address 8.4

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/Session/AccountProxy.php, line 111
Contains \Drupal\restrict_by_ip\Session\AccountProxy.

Class

AccountProxy
When the current user is loaded, remove any roles that are restricted based on IP whitelists. Proxy all other method calls to the original current_user service.

Namespace

Drupal\restrict_by_ip\Session

Code

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