You are here

function lingotek_admin_add_module_index_job in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_admin_add_module_index_job()
  2. 7.4 lingotek.admin.inc \lingotek_admin_add_module_index_job()
  3. 7.5 lingotek.admin.inc \lingotek_admin_add_module_index_job()
1 string reference to 'lingotek_admin_add_module_index_job'
lingotek_admin_prepare_builtins in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 1047

Code

function lingotek_admin_add_module_index_job($module, &$context) {
  $context['message'] = t('Gathering translatable strings in @type: @name', array(
    '@type' => $module->type,
    '@name' => $module->name,
  ));
  $real_uri = $_SERVER['REQUEST_URI'];

  // save the real URI in order to record module names for the location
  module_load_include('inc', 'potx', 'potx');

  // translations *not* available from localize.drupal.org
  $_SERVER['REQUEST_URI'] = 'module:' . $module->name;
  $path = pathinfo($module->filename);
  $path = DRUPAL_ROOT . '/' . drupal_get_path('module', $module->name);
  $files = _potx_explore_dir($path = $path);
  foreach ($files as $file) {
    set_time_limit(LINGOTEK_FILE_PROCESS_TIMEOUT);
    _potx_process_file($file);

    // populates the global variables '$potx_strings' and '$potx_install'
  }
  lingotek_admin_save_queued_strings();
  $_SERVER['REQUEST_URI'] = $real_uri;
}