function locale_system_update

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.

Parameters

$components: An array of component (theme and/or module) names to import translations for.

2 calls to locale_system_update()
locale_modules_installed in drupal/core/modules/locale/locale.module
Implements hook_modules_installed().
locale_themes_enabled in drupal/core/modules/locale/locale.module
Implements hook_themes_enabled().

File

drupal/core/modules/locale/locale.module, line 452
Enables the translation of the user interface to languages other than English.

Code

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);
    }
  }
}