1 language.admin.inc language_admin_add_custom_form_submit($form, &$form_state)

Process the custom language addition form submission.

File

core/modules/language/language.admin.inc, line 263
Admin page callbacks for the Language module.

Code

function language_admin_add_custom_form_submit($form, &$form_state) {
  $langcode = $form_state['values']['langcode'];
  // Custom language form.
  $language = (object) array(
    'langcode' => $langcode,
    'name' => $form_state['values']['name'],
    'direction' => $form_state['values']['direction'],
  );
  language_save($language);
  backdrop_set_message(t('The language %language has been created and can now be used.', array('%language' => $form_state['values']['name'])));
  $form_state['redirect'] = 'admin/config/regional/language';
}