function locale_form_language_admin_edit_form_alter

Same name and namespace in other branches
  1. 9 core/modules/locale/locale.module \locale_form_language_admin_edit_form_alter()
  2. 10 core/modules/locale/locale.module \locale_form_language_admin_edit_form_alter()
  3. 11.x core/modules/locale/locale.module \locale_form_language_admin_edit_form_alter()

Implements hook_form_FORM_ID_alter() for language_admin_edit_form().

File

core/modules/locale/locale.module, line 718

Code

function locale_form_language_admin_edit_form_alter(&$form, FormStateInterface $form_state) {
    if ($form['langcode']['#type'] == 'value' && $form['langcode']['#value'] == 'en') {
        $form['locale_translate_english'] = [
            '#title' => t('Enable interface translation to English'),
            '#type' => 'checkbox',
            '#default_value' => \Drupal::configFactory()->getEditable('locale.settings')
                ->get('translate_english'),
        ];
        $form['actions']['submit']['#submit'][] = 'locale_form_language_admin_edit_form_alter_submit';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.