Problem/Motivation
When running the drush locale:check command on our Drupal site, we have encountered a recurring issue where existing .po files are deleted and replaced with more general .po files if a specific .po file for a module or core version is not found. For example, we are currently running Drupal core version 10.2.7 and have a drupal-10.2.6-de.po file. When drush locale:check is executed, this file gets deleted and replaced with a drupal-10.x-de.po file.
Steps to reproduce (only until a new 10.2.7 .po file is available)
Steps to Reproduce
Use Drupal core version 10.2.7.
Place a specific .po file (e.g., drupal-10.2.6-de.po) in the translations directory.
Run the command drush locale:check.
Observe that the specific .po file is deleted and replaced by a more general drupal-10.x-de.po file.
Expected Behavior
The drush locale:check command should check for and update translations without deleting existing .po files that are specific to the current Drupal core version or modules.
Actual Behavior
The drush locale:check command deletes existing version-specific .po files if they are not matched and replaces them with more general .po files. This causes a loss of specific translations that were manually added.
Impact
This behavior is problematic as it leads to the loss of detailed and specific translations. It also introduces additional manual steps to ensure translations are correctly reapplied after running drush locale:check.
Possible Workarounds
Manually download and place the necessary .po files after running drush locale:check.
Use scripts to ensure the presence of specific .po files and prevent their deletion.
Suggested Solution
Enhance the drush locale:check functionality to preserve existing .po files and avoid replacing them with general files unless explicitly instructed. Alternatively, implement a more intelligent matching mechanism that respects version-specific files and only updates when a correct replacement is found.