Commit 10ee8884 authored by catch's avatar catch
Browse files

fix: #3609363 Regression: install_import_translations() no longer lets...

fix: #3609363 Regression: install_import_translations() no longer lets contrib/custom translations override core on install-from-config

By: chr.fritsch
By: nicxvan
By: alexpott
(cherry picked from commit 7056932d)
parent 340ccd3f
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1758,7 +1758,7 @@ function install_import_translations(&$install_state) {
  // should import translations.
  $languages = \Drupal::languageManager()->getLanguages();
  if (count($languages) > 1 || !isset($languages['en'])) {
    return \Drupal::service(LocaleFetch::class)->buildUpdateBatch();
    return \Drupal::service(LocaleFetch::class)->buildUpdateBatch(['drupal']);
  }
}

+7 −0
Original line number Diff line number Diff line
name: 'Locale test additional'
type: module
description: 'Additional test module for locale translation testing.'
package: Testing
version: '1.0'
hidden: true
'interface translation project': locale_test_additional
+30 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\locale_test_additional\Hook;

use Drupal\Core\Extension\Extension;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for locale_test_extra.
 */
class LocaleTestAdditionalHooks {

  /**
   * Implements hook_system_info_alter().
   *
   * By default this modules is hidden but once enabled it behaves like a normal
   * (not hidden) module. This hook implementation changes the .info.yml data by
   * setting the hidden status to FALSE.
   */
  #[Hook('system_info_alter')]
  public function systemInfoAlter(&$info, Extension $file, $type): void {
    if ($file->getName() == 'locale_test_additional') {
      // Don't hide the module.
      $info['hidden'] = FALSE;
    }
  }

}
+7 −0
Original line number Diff line number Diff line
name: 'Locale test extra'
type: module
description: 'Extra test module for locale translation testing.'
package: Testing
version: '1.0'
hidden: true
'interface translation project': locale_test_extra
+30 −0
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\locale_test_extra\Hook;

use Drupal\Core\Extension\Extension;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for locale_test_extra.
 */
class LocaleTestExtraHooks {

  /**
   * Implements hook_system_info_alter().
   *
   * By default this modules is hidden but once enabled it behaves like a normal
   * (not hidden) module. This hook implementation changes the .info.yml data by
   * setting the hidden status to FALSE.
   */
  #[Hook('system_info_alter')]
  public function systemInfoAlter(&$info, Extension $file, $type): void {
    if ($file->getName() == 'locale_test_extra') {
      // Don't hide the module.
      $info['hidden'] = FALSE;
    }
  }

}
Loading