Skip to content
Snippets Groups Projects
Commit 68a730c7 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#204946 by theborg, keith.smith: only tell users their language setting will...

#204946 by theborg, keith.smith: only tell users their language setting will be used for interface presentation, when this actually happens
parent 66b7a5cb
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -209,7 +209,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
// admin interface or edit the user, show the language selector.
if (variable_get('language_count', 1) > 1 && ($type == 'register' && user_access('administer users') || $type == 'form' && $category == 'account' )) {
$languages = language_list('enabled');
$languages = $languages['1'];
$languages = $languages[1];
// If the user is being created, we set the user language to the page language.
$user_preferred_language = $user ? user_preferred_language($user) : $language;
......@@ -225,12 +225,14 @@ function locale_user($type, $edit, &$user, $category = NULL) {
'#weight' => 1,
);
// Get language negotiation settings.
$mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
$form['locale']['language'] = array(
'#type' => (count($names) <= 5 ? 'radios' : 'select'),
'#title' => t('Language'),
'#default_value' => $user_preferred_language->language,
'#options' => $names,
'#description' => t('Sets the default site interface and e-mail language for this account.'),
'#description' => ($mode == LANGUAGE_NEGOTIATION_PATH) ? t("This account's default language for e-mails, and preferred language for site presentation.") : t("This account's default language for e-mails."),
);
return $form;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment