_locale_admin_manage_add_screen

Definition

_locale_admin_manage_add_screen()
includes/locale.inc, line 128

Description

User interface for the language addition screen.

Code

<?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;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.