Solve the failing download translations from ftp.drupal.org

Problem

Installing a new module on Drupal, the system looks for the module translation based on the website languages.

The process fails most of the time, and consequently it leads to failed deployment.

Root Cause

The root cause of the problem is that the default PO server is misconfigured and returns 403 for most of the request.

Solution

The PO server answer correctly just adding an additional slash inside the URL 

from https://ftp.drupal.org/files/translations to https://ftp.drupal.org/files//translations

To solve the issue

  1. edit the config locale.settings, usual path: config/sync/locale.settings.yml
  2. change the value for default_server_pattern from 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po' to 'https://ftp.drupal.org/files//translations/%core/%project/%project-%version.%language.po'
  3. verify that the path exists and it is writable by the server.
cache_strings: true
translate_english: false
javascript:
directory: languages
translation:
use_source: remote_and_local
default_filename: '%project-%version.%language.po'
default_server_pattern: 'https://ftp.drupal.org/files//translations/%core/%project/%project-%version.%language.po'
overwrite_customized: false
overwrite_not_customized: true
update_interval_days: 0
path: sites/default/files/translations
import_enabled: true


 

References