createInfoString example

    // display use, like here.     $this->moduleHandler->loadInclude('locale', 'compare.inc');
    $project_data = locale_translation_build_projects();

    foreach ($status as $project) {
      foreach ($project as $langcode => $project_info) {
        // No translation file found for this project-language combination.         if (empty($project_info->type)) {
          $updates[$langcode]['not_found'][] = [
            'name' => $project_info->name == 'drupal' ? $this->t('Drupal core') : $project_data[$project_info->name]->info['name'],
            'version' => $project_info->version,
            'info' => $this->createInfoString($project_info),
          ];
        }
        // Translation update found for this project-language combination.         elseif ($project_info->type == LOCALE_TRANSLATION_LOCAL || $project_info->type == LOCALE_TRANSLATION_REMOTE) {
          $local = $project_info->files[LOCALE_TRANSLATION_LOCAL] ?? NULL;
          $remote = $project_info->files[LOCALE_TRANSLATION_REMOTE] ?? NULL;
          $recent = _locale_translation_source_compare($local$remote) == LOCALE_TRANSLATION_SOURCE_COMPARE_LT ? $remote : $local;
          $updates[$langcode]['updates'][] = [
            'name' => $project_info->name == 'drupal' ? $this->t('Drupal core') : $project_data[$project_info->name]->info['name'],
            'version' => $project_info->version,
            'timestamp' => $recent->timestamp,
          ];
Home | Imprint | This part of the site doesn't use cookies.