function locale_language_from_user

Identify language from the user preferences.

Parameters

$languages: An array of valid language objects.

Return value

A valid language code on success, FALSE otherwise.

Related topics

1 string reference to 'locale_language_from_user'
locale_language_negotiation_info in modules/locale/locale.module
Implements hook_language_negotiation_info().

File

includes/locale.inc, line 213

Code

function locale_language_from_user($languages) {
    // User preference (only for logged users).
    global $user;
    if ($user->uid) {
        return $user->language;
    }
    // No language preference from the user.
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.