diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 61019018e8a6dfc5c6314628e6aacd0740a91228..907200a8f34555874bd543630e35f92905525018 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1939,7 +1939,7 @@ function install_check_translations($langcode, $server_pattern) { $variables = [ '%project' => 'drupal', '%version' => $version, - '%core' => \Drupal::CORE_COMPATIBILITY, + '%core' => 'all', '%language' => $langcode, ]; $translation_url = strtr($server_pattern, $variables); diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 74aa1faa508a5184639f8ae741709421eb849282..317b45adb5363af57396e312729e4437c945850b 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -69,7 +69,7 @@ function locale_translation_build_projects() { $data += [ 'name' => $name, 'version' => isset($data['info']['version']) ? $data['info']['version'] : '', - 'core' => \Drupal::CORE_COMPATIBILITY, + 'core' => 'all', // A project can provide the path and filename pattern to download the // gettext file. Use the default if not. 'server_pattern' => isset($data['info']['interface translation server pattern']) && $data['info']['interface translation server pattern'] ? $data['info']['interface translation server pattern'] : $default_server['pattern'], diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index 6295cbcfce79ce4290612f8db9cf00f519f350ca..649f737d8f454085c016fd75e0c08b0d5fdfed96 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -328,3 +328,10 @@ function locale_update_8500() { ->save(); } } + +/** + * Clear Locale project storage to use new 'all' instead of 8.x in URLs. + */ +function locale_update_8800() { + \Drupal::service('locale.project')->deleteAll(); +} diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php index a6f43d46b1232b389b0a6328d571b2bf7d772666..f97a8d607cfd8f7e14ed3e34d8ce8025d82c3ab4 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslationDownloadTest.php @@ -49,7 +49,7 @@ public function testUpdateImportSourceRemote() { ], $this->translationsStream); $url = \Drupal::service('url_generator')->generateFromRoute('<front>', [], ['absolute' => TRUE]); - $uri = $url . PublicStream::basePath() . '/remote/8.x/contrib_module_one/contrib_module_one-8.x-1.1.de._po'; + $uri = $url . PublicStream::basePath() . '/remote/all/contrib_module_one/contrib_module_one-8.x-1.1.de._po'; $source_file = (object) [ 'uri' => $uri, ]; diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php index ab3df49ca56759aec579a61fcf5346e96c7d1cd5..05221fb997ea5c6483f76c59326dcccf436326c4 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @@ -194,9 +194,9 @@ protected function setTranslationFiles() { // Add a number of files to the local file system to serve as remote // translation server and match the project definitions set in // locale_test_locale_translation_projects_alter(). - $this->makePoFile('remote/8.x/contrib_module_one', 'contrib_module_one-8.x-1.1.de._po', $this->timestampNew, $translations_one); - $this->makePoFile('remote/8.x/contrib_module_two', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestampOld, $translations_two); - $this->makePoFile('remote/8.x/contrib_module_three', 'contrib_module_three-8.x-1.0.de._po', $this->timestampOld, $translations_three); + $this->makePoFile('remote/all/contrib_module_one', 'contrib_module_one-8.x-1.1.de._po', $this->timestampNew, $translations_one); + $this->makePoFile('remote/all/contrib_module_two', 'contrib_module_two-8.x-2.0-beta4.de._po', $this->timestampOld, $translations_two); + $this->makePoFile('remote/all/contrib_module_three', 'contrib_module_three-8.x-1.0.de._po', $this->timestampOld, $translations_three); // Add a number of files to the local file system to serve as local // translation files and match the project definitions set in diff --git a/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php b/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php index 5e918cc82205d34364c750d1e9de243aeafef232..3156acbdae015de58141a1a42ae661c5af9c3336 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleBuildTest.php @@ -36,10 +36,10 @@ public function testBuildProjects() { // Confirm the project name and core value before the module is altered. $projects = locale_translation_build_projects(); $this->assertSame('locale_test', $projects['locale_test']->name); - $this->assertSame('8.x', $projects['locale_test']->core); + $this->assertSame('all', $projects['locale_test']->core); $projects['locale_test']->langcode = 'de'; - $this->assertSame('/8.x/locale_test/locale_test-1.2.de.po', locale_translation_build_server_pattern($projects['locale_test'], '/%core/%project/%project-%version.%language.po')); + $this->assertSame('/all/locale_test/locale_test-1.2.de.po', locale_translation_build_server_pattern($projects['locale_test'], '/%core/%project/%project-%version.%language.po')); // Alter both the name and core value of the project. \Drupal::state()->set('locale.test_system_info_alter_name_core', TRUE); @@ -55,10 +55,10 @@ public function testBuildProjects() { // Confirm the name and core value are not changed in the project. $projects = locale_translation_build_projects(); $this->assertSame('locale_test', $projects['locale_test']->name); - $this->assertSame('8.x', $projects['locale_test']->core); + $this->assertSame('all', $projects['locale_test']->core); $projects['locale_test']->langcode = 'de'; - $this->assertSame('/8.x/locale_test/locale_test-1.2.de.po', locale_translation_build_server_pattern($projects['locale_test'], '/%core/%project/%project-%version.%language.po')); + $this->assertSame('/all/locale_test/locale_test-1.2.de.po', locale_translation_build_server_pattern($projects['locale_test'], '/%core/%project/%project-%version.%language.po')); } }