function install_select_locale_form

7.x install.core.inc install_select_locale_form($form, &$form_state, $locales, $profilename)
6.x install.php install_select_locale_form(&$form_state, $locales)

Form API array definition for language selection.

1 string reference to 'install_select_locale_form'
install_select_locale in drupal-6.x/install.php
Allow admin to select which locale to use for the current profile.

File

drupal-6.x/install.php, line 597

Code

function install_select_locale_form(&$form_state, $locales) {
  include_once './includes/locale.inc';
  $languages = _locale_get_predefined_list();
  foreach ($locales as $locale) {
    // Try to use verbose locale name
    $name = $locale->name;
    if (isset($languages[$name])) {
      $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : '');
    }
    $form['locale'][$locale->name] = array(
      '#type' => 'radio',
      '#return_value' => $locale->name,
      '#default_value' => ($locale->name == 'en' ? TRUE : FALSE),
      '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''),
      '#parents' => array('locale')
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => st('Select language'),
  );
  return $form;
}