Option to suppress translation download on local

Created on 30 October 2024, 5 months ago

Problem/Motivation

When working locally, I don't want po files to be updated every time I run `drush deploy`, because it's quite time-consuming.

  ddev drush deploy
 [notice] Database updates start.
>  [success] No pending updates.

 Do you wish to update translations from local po files? (yes/no) [yes]:
 > >  [notice] Running post updatedb locale deploy to ensure translations are up-to-date with po files.

Proposed resolution

When working locally, I don't want po files to be updated every time I run `drush deploy`, because it's quite time-consuming.

```
ddev drush deploy
[notice] Database updates start.
> [success] No pending updates.

Do you wish to update translations from local po files? (yes/no) [yes]:
> > [notice] Running post updatedb locale deploy to ensure translations are up-to-date with po files.
```

Thinking out loud: maybe a possible way forward is to have a config override in `settings.local.php`

$config['locale.settings']['update_translations'] = FALSE;

... such that the config settings is respected here:

`docroot/modules/contrib/locale_deploy/src/Commands/LocaleDeployCommands.php`

  public function postUpdateDbHook(int $result): void {
    if ($result === 0) {
      if (!$this->io()->confirm(dt('Do you wish to update translations from local po files?'))) {
        return;
      }
      $this->logger()?->notice('Running post updatedb locale deploy to ensure translations are up-to-date with po files.');

... so that the translations are not downloaded every time I run `drush deploy` on local.

๐Ÿ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany michaellenahan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024