You are here

function install_select_locale_form in Drupal 5

Same name and namespace in other branches
  1. 6 install.php \install_select_locale_form()
  2. 7 includes/install.core.inc \install_select_locale_form()
1 string reference to 'install_select_locale_form'
install_select_locale in ./install.php
Find all .po files for the current profile and allow admin to select which to use.

File

./install.php, line 471

Code

function install_select_locale_form($locales) {
  include_once './includes/locale.inc';
  $languages = _locale_get_iso639_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('Save configuration'),
  );
  return $form;
}