function LocaleHooks::formSystemFileSystemSettingsAlter

Same name and namespace in other branches
  1. 11.x core/modules/locale/src/Hook/LocaleHooks.php \Drupal\locale\Hook\LocaleHooks::formSystemFileSystemSettingsAlter()

Implements hook_form_FORM_ID_alter() for system_file_system_settings().

Add interface translation directory setting to directories configuration.

Attributes

#[Hook('form_system_file_system_settings_alter')]

File

core/modules/locale/src/Hook/LocaleHooks.php, line 362

Class

LocaleHooks
Hook implementations for locale.

Namespace

Drupal\locale\Hook

Code

public function formSystemFileSystemSettingsAlter(&$form, FormStateInterface $form_state) : void {
  $form['translation_path'] = [
    '#type' => 'item',
    '#title' => $this->t('Interface translations directory'),
    '#markup' => TranslationsStream::basePath(),
    '#description' => $this->t('A local file system path where interface translation files will be stored. This must be changed in settings.php file as the "locale_translation_path" setting.'),
  ];
  if ($form['file_default_scheme']) {
    $form['file_default_scheme']['#weight'] = 20;
  }
}

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