function locale_system_file_system_settings_submit

locale_system_file_system_settings_submit(&$form, FormStateInterface $form_state)

Submit handler for the file system settings form.

Clears the translation status when the Interface translations directory changes. Without a translations directory local po files in the directory should be ignored. The old translation status is no longer valid.

File

core/modules/locale/locale.module, line 776
Enables the translation of the user interface to languages other than English.

Code

function locale_system_file_system_settings_submit(&$form, FormStateInterface $form_state) {
  if ($form['translation_path']['#default_value'] != $form_state->getValue('translation_path')) {
    locale_translation_clear_status();
  }

  \Drupal::configFactory()->getEditable('locale.settings')
    ->set('translation.path', $form_state->getValue('translation_path'))
    ->save();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.module/function/locale_system_file_system_settings_submit/8.1.x