- Issue created by @tess bakker
- First commit to issue fork.
- Merge request !28Issue #3444016: New Drush command for developers for extracting translations... → (Open) created by idebr
- Status changed to Needs work
about 1 year ago 12:26pm 16 September 2024 - Issue was unassigned.
- 🇫🇷France johnatas
Hi,
Thanks for the work on this!
Unfortunately, it wasn't fully "plug & play" on my side.
For context, I'm using Drupal core version 11.2.2 and module version 1.1.0.I made a few small adjustments to get things working in my environment.
Here are the changes I applied:- Added a check for
$projectName
before checking its status → In case it's NULL (e.g., when simply runningdrush pet
), it would otherwise throw an error. - Replaced
FileSystemInterface::EXISTS_REPLACE
withFileExists::Replace
→ This has been deprecated since Drupal 10.3.0. - In my project (maybe due to my config?), the generated file for each module/theme is always named general.pot, regardless of the options passed → So I replaced:
$translationStoredFile = $translationsDirectory . '/' . $projectKey . '-' . $languageCode . '.po';
with$translationStoredFile = 'general.pot';
- Removed the
create()
method in favor of proper dependency injection. - Few optional improvements, such as adding type hint to constant and marking properties as readonly.
Since I'm not sure whether these changes are compatible for everyone, I didn't commit them to the MR — but I'm attaching the patch I used.
- Added a check for