Problem/Motivation
In some situations the translations directory (where downloaded translation files get stored; e.g. sites/default/files/translations) is missing. This may happen for example in a development process, where a site is re-created on a dev machine from git and a live DB but without populating the files directory (as you use StageFileProxy).
Simplified steps to reproduce in a normally working site (translations directory = sites/default/files/translations)
$ rm -r sites/default/files/translations
$ drush locale-update
Example error messages:
[notice] File temporary://filejmiMlj could not be moved/copied because the destination directory translations:// is not configured correctly.
[error] Unable to download translation file https://ftp.drupal.org/files/translations/8.x/admin_toolbar/admin_toolbar-8.x-1.24.de.po.
[warning] fopen(translations://admin_toolbar-8.x-1.24.de.po): failed to open stream: "Drupal\locale\StreamWrapper\TranslationsStream::stream_open" call failed PoStreamReader.php:154
[warning] fgets() expects parameter 1 to be resource, boolean given PoStreamReader.php:248
[notice] Unable to import translations file: translations://admin_toolbar-8.x-1.24.de.po
Proposed resolution
- Autocreate the directory if at the start of the batch check/update process.
Remaining tasks
- Find other other processes where the translation directory is yet not auto-created.
User interface changes
none
API changes
none
Data model changes
none