Same name and namespace in other branches
- 4.7.x modules/locale.module \locale_user()
- 5.x modules/locale/locale.module \locale_user()
- 6.x modules/locale/locale.module \locale_user()
Implementation of hook_user().
File
- modules/
locale.module, line 103 - Enables administrators to manage the site interface languages.
Code
function locale_user($type, $edit, &$user, $category = NULL) {
$languages = locale_supported_languages();
if ($type == 'form' && $category == 'account' && count($languages['name']) > 1) {
if ($user->language == '') {
$user->language = key($languages['name']);
}
$languages['name'] = array_map('check_plain', $languages['name']);
return array(
array(
'title' => t('Interface language settings'),
'data' => form_radios(t("Language"), 'language', $user->language, $languages['name'], t("Selecting a different locale will change the interface language of the site.")),
),
);
}
}