Imports translations when new modules or themes are installed.
This function will either import translation for the component change right away, or start a batch if more files need to be imported.
@todo This currently imports all .po files available, independent of $components. Once we integrated with update status for project identification, we should revisit and only import files for the identified projects for the components.
$components: An array of component (theme and/or module) names to import translations for.
function locale_system_update($components) {
// Skip running the translation imports if in the installer,
// because it would break out of the installer flow. We have
// built-in support for translation imports in the installer.
if (!drupal_installation_attempted()) {
include_once drupal_get_path('module', 'locale') . '/locale.bulk.inc';
if ($batch = locale_translate_batch_import_files(array(), TRUE)) {
batch_set($batch);
}
}
}