Commit f96a1c76 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#205334 by hass: if more then 5 languages are available, use a dropdown not a...

#205334 by hass: if more then 5 languages are available, use a dropdown not a radio button list (usability)
parent 5f635b95
......@@ -550,7 +550,8 @@ function locale_translate_seek_form() {
'#default_value' => @$query['string'],
'#description' => t('Leave blank to show all strings. The search is case sensitive.'),
);
$form['search']['language'] = array('#type' => 'radios',
$form['search']['language'] = array(
'#type' => (count($languages) <= 5 ? 'radios' : 'select'),
'#title' => t('Language'),
'#default_value' => (!empty($query['language']) ? $query['language'] : 'all'),
'#options' => array_merge(array('all' => t('All languages'), 'en' => t('English (provided by Drupal)')), $languages),
......
......@@ -226,7 +226,7 @@ function locale_user($type, $edit, &$user, $category = NULL) {
);
$form['locale']['language'] = array(
'#type' => 'radios',
'#type' => (count($names) <= 5 ? 'radios' : 'select'),
'#title' => t('Language'),
'#default_value' => $user_preferred_language->language,
'#options' => $names,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment