_locale_admin_manage_add_screen

  1. drupal
    1. 4.7
    2. 5
Versions
4.7 – 5 _locale_admin_manage_add_screen()

User interface for the language addition screen.

Code

includes/locale.inc, line 129

<?php
function _locale_admin_manage_add_screen() {
  $isocodes = _locale_prepare_iso_list();

  $form = array();
  $form['language list'] = array(
    '#type' => 'fieldset', 
    '#title' => t('Language list'), 
    '#collapsible' => TRUE,
  );
  $form['language list']['langcode'] = array(
    '#type' => 'select', 
    '#title' => t('Language name'), 
    '#default_value' => key($isocodes), 
    '#options' => $isocodes, 
    '#description' => t('Select your language here, or add it below, if you are unable to find it.'),
  );
  $form['language list']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add language'),
  );

  $output = drupal_get_form('locale_add_language_form', $form);

  $form = array();
  $form['custom language'] = array(
    '#type' => 'fieldset', 
    '#title' => t('Custom language'), 
    '#collapsible' => TRUE,
  );
  $form['custom language']['langcode'] = array(
    '#type' => 'textfield', 
    '#title' => t('Language code'), 
    '#size' => 12, 
    '#maxlength' => 60, 
    '#required' => TRUE, 
    '#description' => t("Commonly this is an <a href=\"%iso-codes\">ISO 639 language code</a> with an optional country code for regional variants. Examples include 'en', 'en-US' and 'zh-cn'.", array('%iso-codes' => 'http://www.w3.org/WAI/ER/IG/ert/iso639.htm')),
  );
  $form['custom language']['langname'] = array(
    '#type' => 'textfield', 
    '#title' => t('Language name in English'), 
    '#maxlength' => 64, 
    '#required' => TRUE, 
    '#description' => t('Name of the language. Will be available for translation in all languages.'),
  );
  $form['custom language']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add custom language'),
  );

  // Use the validation and submit functions of the add language form.
  $output .= drupal_get_form('locale_custom_language_form', $form, 'locale_add_language_form');

  return $output;
}
?>