You are here

function locale_update_8500 in Drupal 8

Update default server pattern value to use https.

File

core/modules/locale/locale.install, line 323
Install, update, and uninstall functions for the Locale module.

Code

function locale_update_8500() {
  $update_url = \Drupal::config('locale.settings')
    ->get('translation.default_server_pattern');
  if ($update_url == 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po') {
    \Drupal::configFactory()
      ->getEditable('locale.settings')
      ->set('translation.default_server_pattern', 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po')
      ->save();
  }
}