diff --git a/core/modules/locale/config/locale.settings.yml b/core/modules/locale/config/locale.settings.yml index 16b08ff..02e8af0 100644 --- a/core/modules/locale/config/locale.settings.yml +++ b/core/modules/locale/config/locale.settings.yml @@ -10,3 +10,4 @@ translation: overwrite_not_customized: '1' update_interval_days: '0' path: '' + import_enabled: '1' diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index dcca8bf..64246de 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -450,7 +450,7 @@ function locale_system_update(array $components) { // Skip running the translation imports if in the installer, // because it would break out of the installer flow. We have // built-in support for translation imports in the installer. - if (!drupal_installation_attempted() && locale_translatable_language_list()) { + if (!drupal_installation_attempted() && locale_translatable_language_list() && config('locale.settings')->get('translation.import_enabled')) { module_load_include('compare.inc', 'locale'); // Update the list of translatable projects and start the import batch. @@ -704,12 +704,13 @@ function locale_form_language_admin_add_form_alter(&$form, &$form_state) { * Set a batch for a newly-added language. */ function locale_form_language_admin_add_form_alter_submit($form, $form_state) { - if (empty($form_state['values']['predefined_langcode']) || $form_state['values']['predefined_langcode'] == 'custom') { - $langcode = $form_state['values']['langcode']; - } - else { - $langcode = $form_state['values']['predefined_langcode']; - } + if (config('locale.settings')->get('translation.import_enabled')) { + if (empty($form_state['values']['predefined_langcode']) || $form_state['values']['predefined_langcode'] == 'custom') { + $langcode = $form_state['values']['langcode']; + } + else { + $langcode = $form_state['values']['predefined_langcode']; + } // Download and import translations for the newly added language. module_load_include('fetch.inc', 'locale');