User's default language

How to get user's default language set in the user profile, backend set in Users table uDefaultLanguage field?

Localization::activeLanguage(); does not bring me that user's default language.

View Replies:
Janks replied on at Permalink Reply
I made my own function as there is no such in the core code:
function GetUserLocale($UserID) {
    $db = Loader::db();
    $UserLocale = $db->GetOne("SELECT IFNULL(U.uDefaultLanguage, 'None') FROM Users U WHERE U.uID=".$UserID);
    return $UserLocale;
mlocati replied on at Permalink Reply
There's a way to get the user preferred language:

$u = new \Concrete\Core\User\User();
$userPreferredLanguage = $u->getUserDefaultLanguage();