function install_import_translations
Same name and namespace in other branches
- 11.x core/includes/install.core.inc \install_import_translations()
- 10 core/includes/install.core.inc \install_import_translations()
- 9 core/includes/install.core.inc \install_import_translations()
- 8.9.x core/includes/install.core.inc \install_import_translations()
Imports languages via a batch process during installation.
Parameters
array $install_state: An array of information about the current installation state.
Return value
array|null The batch definition, if there are language files to import.
File
-
core/
includes/ install.core.inc, line 1757
Code
function install_import_translations(&$install_state) {
install_download_additional_translations_operations($install_state);
// If there is more than one language or the single one is not English, we
// should import translations.
$languages = \Drupal::languageManager()->getLanguages();
if (count($languages) > 1 || !isset($languages['en'])) {
return \Drupal::service(LocaleFetch::class)->buildUpdateBatch();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.