function theme_locale_translation_update_info

Returns HTML for translation status information per language.

Parameters

array $variables: An associative array containing:

  • updates: The projects which have updates.
  • not_found: The projects which updates are not found.

See also

locale_translation_status_form()

Related topics

1 theme call to theme_locale_translation_update_info()
locale_translation_status_form in drupal/core/modules/locale/locale.pages.inc
Page callback: Display the current translation status.

File

drupal/core/modules/locale/locale.pages.inc, line 749
Interface translation summary, editing and deletion user interfaces.

Code

function theme_locale_translation_update_info($variables) {
  $description = $details = '';

  // Build output for available updates.
  if (isset($variables['updates'])) {
    if ($variables['updates']) {
      $releases = array();
      foreach ($variables['updates'] as $update) {
        $modules[] = $update['name'];
        $releases[] = t('@module (@date)', array(
          '@module' => $update['name'],
          '@date' => format_date($update['timestamp'], 'html_date'),
        ));
      }
    }
    $description = '<span class="text">' . t('Updates for: @modules', array(
      '@modules' => implode(', ', $modules),
    )) . '</span>';
    $details = theme('item_list', array(
      'items' => $releases,
    ));
  }

  // Build output for updates not found.
  if (isset($variables['not_found'])) {
    if (empty($description)) {
      $description = '<span class="text">' . format_plural(count($variables['not_found']), 'Missing translations for one project', 'Missing translations for @count projects') . '</span>';
    }
    if ($variables['not_found']) {
      $releases = array();
      foreach ($variables['not_found'] as $update) {
        $version = $update['version'] ? $update['version'] : t('no version');
        $releases[] = t('@module (@version).', array(
          '@module' => $update['name'],
          '@version' => $version,
        )) . ' ' . $update['info'];
      }
    }
    if ($details) {
      $details .= t('Missing translations for:');
    }
    $details .= theme('item_list', array(
      'items' => $releases,
    ));
  }
  $output = '<div class="inner" tabindex="0" role="button">';
  $output .= '<span class="update-description-prefix element-invisible">Show description</span>' . $description;
  $output .= $details ? '<div class="details">' . $details . '</div>' : '';
  $output .= '</div>';
  return $output;
}