You are here

function install_download_translation in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/install.core.inc \install_download_translation()
  2. 9 core/includes/install.core.inc \install_download_translation()

Download a translation file for the selected language.

Parameters

array $install_state: An array of information about the current installation state.

Return value

string A themed status report, or an exception if there are requirement errors. Upon successful download the page is reloaded and no output is returned.

1 call to install_download_translation()
install_config_download_translations in core/includes/install.core.inc
Replaces install_download_translation() during configuration installs.
1 string reference to 'install_download_translation'
install_tasks in core/includes/install.core.inc
Returns a list of all tasks the installer currently knows about.

File

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

Code

function install_download_translation(&$install_state) {

  // Check whether all conditions are met to download. Download the translation
  // if possible.
  $requirements = install_check_translations($install_state['parameters']['langcode'], $install_state['server_pattern']);

  // Render requirements if any warnings or errors returned.
  if ($output = install_display_requirements($install_state, $requirements)) {
    return $output;
  }

  // The download was successful, reload the page in the new language.
  $install_state['translations'][$install_state['parameters']['langcode']] = TRUE;
  if ($install_state['interactive']) {
    install_goto(install_redirect_url($install_state));
  }
}