diff -u b/core/includes/install.core.inc b/core/includes/install.core.inc --- b/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1624,7 +1624,7 @@ */ function install_import_translations(&$install_state) { $module_handler = \Drupal::moduleHandler(); - if ($module_handler->moduleExists('locale')) { + if (!$module_handler->moduleExists('locale')) { // Early return for install profile that does not enable locale module. return; } @@ -1716,9 +1716,14 @@ * An array of batch definitions. */ function install_finish_translations(&$install_state) { - \Drupal::moduleHandler()->loadInclude('locale', 'fetch.inc'); - \Drupal::moduleHandler()->loadInclude('locale', 'compare.inc'); - \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc'); + $module_handler = \Drupal::moduleHandler(); + if (!$module_handler->moduleExists('locale')) { + // Early return for install profile that does not enable locale module. + return array(); + } + $module_handler->loadInclude('locale', 'fetch.inc'); + $module_handler->loadInclude('locale', 'compare.inc'); + $module_handler->loadInclude('locale', 'bulk.inc'); // Build a fresh list of installed projects. When more projects than core are // installed, their translations will be downloaded (if required) and imported