function AccountInterface::getPreferredAdminLangcode
Same name in other branches
- 9 core/lib/Drupal/Core/Session/AccountInterface.php \Drupal\Core\Session\AccountInterface::getPreferredAdminLangcode()
- 10 core/lib/Drupal/Core/Session/AccountInterface.php \Drupal\Core\Session\AccountInterface::getPreferredAdminLangcode()
- 11.x core/lib/Drupal/Core/Session/AccountInterface.php \Drupal\Core\Session\AccountInterface::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).
3 methods override AccountInterface::getPreferredAdminLangcode()
- AccountProxy::getPreferredAdminLangcode in core/
lib/ Drupal/ Core/ Session/ AccountProxy.php - Returns the preferred administrative language code of the account.
- User::getPreferredAdminLangcode in core/
modules/ user/ src/ Entity/ User.php - Returns the preferred administrative language code of the account.
- UserSession::getPreferredAdminLangcode in core/
lib/ Drupal/ Core/ Session/ UserSession.php - Returns the preferred administrative language code of the account.
File
-
core/
lib/ Drupal/ Core/ Session/ AccountInterface.php, line 103
Class
- AccountInterface
- Defines an account interface which represents the current user.
Namespace
Drupal\Core\SessionCode
public function getPreferredAdminLangcode($fallback_to_default = TRUE);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.