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

Process the predefined language addition form submission.

File

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

Code

function language_admin_add_predefined_form_submit($form, &$form_state) {
  // Predefined language selection.
  $langcode = $form_state['values']['predefined_langcode'];
  include_once BACKDROP_ROOT . '/core/includes/standard.inc';
  $predefined = standard_language_list();
  $language = (object) array(
    'langcode' => $langcode,
  );
  language_save($language);
  backdrop_set_message(t('The language %language has been created and can now be used.', array('%language' => t($predefined[$langcode][0]))));
  $form_state['redirect'] = 'admin/config/regional/language';
}