function install_get_localization_release

Gets the core release version for localization.

In case core has a development version we fall back to the latest stable release. e.g. 8.2-dev falls back to 8.1. 8.0-dev falls back to 7.0. Fallback is required because the localization server only provides translation files for stable releases.

Return value

array Associative array containing 'core' and 'version' of the release.

2 calls to install_get_localization_release()

File

drupal/core/includes/install.core.inc, line 1639
API functions for installing Drupal.

Code

function install_get_localization_release() {
  if (strpos(VERSION, 'dev')) {
    list($version, ) = explode('-', VERSION);
    list($major, $minor) = explode('.', $version);

    // Calculate the major and minor release numbers to fall back to.
    // E.g. 8.0-dev falls back to 7.0 and 8.2-dev falls back to 8.1.
    if ($minor == 0) {
      $major--;
    }
    else {
      $minor--;
    }
    $release = "{$major}.{$minor}";
  }
  else {
    $release = VERSION;
  }
  return array(
    'core' => "{$major}.x",
    'version' => $release,
  );
}