public AccountProxy::getPreferredLangcode($fallback_to_default = TRUE)
Returns the preferred language code of the account.
bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no language preference.
string The language code that is preferred by the account. 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::getPreferredLangcode
public function getPreferredLangcode($fallback_to_default = TRUE) { return $this->getAccount()->getPreferredLangcode($fallback_to_default); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Session!AccountProxy.php/function/AccountProxy::getPreferredLangcode/8.1.x