Problem/Motivation
In #3590050: Deprecate and replace locale_status related functions (currently only in the 11.x backport), we change how the installer downloads and detects po files during the import-phase. As part of that, we have to update lots of tests from hardcoded 8.0.0 versions to the current version based on Drupal::VERSION.
One concern was the magic -dev replacement that's happening in \Drupal\locale\LocaleProjectRepository::buildProjects() and is also duplicated into the installer in install_check_translations():
elseif (preg_match("/^(\d+\.\d+\.).*$/", $data['info']['version'], $matches)) {
// Example match: 8.0.0-dev => 8.0.x (Drupal core)
$data['info']['version'] = $matches[1] . 'x';
}
But that's not how we do dev versions anymore, we don't do that on patch release. It is not so long ago, it was in #3445211: Composer tests fail because of invalid Drupal version as that is not actually a semantically correct version. It's now for example 11.4-dev or 12.0-dev.
drupal.org handles this now and it supports basically any suffix, including for contrib, these all work:
https://ftp.drupal.org/files/translations/all/drupal/drupal-12.0-dev.de.po
https://ftp.drupal.org/files/translations/all/drupal/drupal-11.4-dev.de.po
https://ftp.drupal.org/files/translations/all/drupal/drupal-8.0.0-dev.de.po
https://ftp.drupal.org/files/translations/all/drupal/drupal-8.0.0-banana...
It also works for contrib if there's an actual release
works: https://ftp.drupal.org/files/translations/all/address/address-2.0.x-dev....
does not work: https://ftp.drupal.org/files/translations/all/address/address-2.x-dev.de.po
Steps to reproduce
Proposed resolution
Removed the regex in those two places, adjust tests.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3594389
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nicxvan commentedComment #3
nicxvan commentedComment #5
berdirIdentified at least one test fail, which uses weird and IMHO invalid version strings to check the regular expressions. Manually tested that the core example would work:
https://ftp.drupal.org/files/translations/all/drupal/drupal-8.0.0-alpha1...
could also completely remove that assertion and the system info alter, as it's not doing anymore anymore and just keep the contrib test. That is unfortunately still needed for now.
Comment #6
nicxvan commented