_locale_batch_build

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/locale.inc, строка 2571

Версии
6
_locale_batch_build($files, $finished = NULL, $components = array())

Build a locale batch from an array of files.

Параметры

$files Array of files to import

$finished Optional finished callback for the batch.

$components Optional list of component names the batch covers. Used in the installer.

Возвращаемое значение

A batch structure

Связанные темы

▾ 2 функции вызывают _locale_batch_build()

locale_batch_by_component in includes/locale.inc
Подготовка пакетной обработки при инсталяции модулей или включении темы. Она импортирует переводы для недавно добавленных компонентов на всех языках, уже настроенных на сайте.
locale_batch_by_language in includes/locale.inc
Подготовка к пакетному импорту переводов для всех включенных модулей данного языка

Код

<?php
function _locale_batch_build($files, $finished = NULL, $components = array()) {
  $t = get_t();
  if (count($files)) {
    $operations = array();
    foreach ($files as $file) {
      // We call _locale_batch_import for every batch operation.
      $operations[] = array('_locale_batch_import', array($file->filename));    }
      $batch = array(
        'operations'    => $operations,
        'title'         => $t('Importing interface translations'),
        'init_message'  => $t('Starting import'),
        'error_message' => $t('Error importing interface translations'),
        'file'          => './includes/locale.inc',
        // This is not a batch API construct, but data passed along to the
        // installer, so we know what did we import already.
        '#components'   => $components,
      );
      if (isset($finished)) {
        $batch['finished'] = $finished;
      }
    return $batch;
  }
  return FALSE;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему