[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> locale.php (source)

   1  <?php
   2  gp_title( sprintf( __( 'Projects translated to %s &lt; GlotPress', 'glotpress' ),  esc_html( $locale->english_name ) ) );
   3  
   4  $breadcrumb = array();
   5  $breadcrumb[] = gp_link_get( gp_url( '/languages' ), __( 'Locales', 'glotpress' ) );
   6  if ( 'default' == $current_set_slug ) {
   7      $breadcrumb[] = esc_html( $locale->english_name );
   8  } else {
   9      $breadcrumb[] = gp_link_get( gp_url_join( gp_url( '/languages' ), $locale->slug ), esc_html( $locale->english_name ) );
  10      $breadcrumb[] = $set_list[ $current_set_slug ];
  11  }
  12  gp_breadcrumb( $breadcrumb );
  13  gp_tmpl_header();
  14  ?>
  15  
  16      <h2><?php printf( __( 'Active Projects translated to %s', 'glotpress' ), esc_html( $locale->english_name ) ); ?>
  17          <?php if ( $locale_glossary ) : ?>
  18              <a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Locale Glossary', 'glotpress' ); ?></a>
  19          <?php elseif ( $can_create_locale_glossary ) : ?>
  20              <a href="<?php echo esc_url( gp_url_join( gp_url( '/languages' ), $locale->slug, $current_set_slug, 'glossary' ) ); ?>" class="glossary-link"><?php _e( 'Create Locale Glossary', 'glotpress' ); ?></a>
  21          <?php endif; ?>
  22      </h2>
  23  
  24  <?php if ( count( $set_list ) > 1 ) : ?>
  25      <p class="actionlist secondary">
  26          <?php echo implode( ' &bull;&nbsp;', $set_list ); ?>
  27      </p>
  28  <?php endif; ?>
  29  
  30  <?php
  31  if ( empty( $projects_data ) ) {
  32      _e( 'No active projects found.', 'glotpress' );
  33  }
  34  ?>
  35  
  36  <?php foreach ( $projects_data as $project_id => $sub_projects ) : ?>
  37      <div class="locale-project">
  38          <h3><?php echo ( $projects[$project_id]->name );?></h3>
  39          <table class="locale-sub-projects">
  40              <thead>
  41              <tr>
  42                  <th class="header" <?php if (count($sub_projects)>1 ) echo 'rowspan="'. count($sub_projects) . '"';?>><?php if (count($sub_projects)>1 ) _e( 'Project', 'glotpress' ); ?></th>
  43                  <th class="header"><?php _e( 'Set / Sub Project', 'glotpress' ); ?></th>
  44                  <th><?php _e( 'Translated', 'glotpress' ); ?></th>
  45                  <th><?php _e( 'Fuzzy', 'glotpress' ); ?></th>
  46                  <th><?php _e( 'Untranslated', 'glotpress' ); ?></th>
  47                  <th><?php _e( 'Waiting', 'glotpress' ); ?></th>
  48              </tr>
  49              </thead>
  50              <tbody>
  51              <?php foreach ( $sub_projects as $sub_project_id => $data ) : ?>
  52                  <tr>
  53                  <th class="sub-project" rowspan="<?php echo count( $data['sets'] );  ?>">
  54                      <?php if (count($sub_projects)>1  ) echo esc_html( $projects[$sub_project_id]->name ); ?>
  55                      <div class="stats">
  56                          <div class="total-strings"><?php printf( __( '%d strings', 'glotpress' ), $data['totals']->all_count ); ?></div>
  57                          <div class="percent-completed"><?php printf( __( '%d%% translated', 'glotpress' ), $data['totals']->current_count ? floor( absint($data['totals']->current_count ) / absint( $data['totals']->all_count ) * 100 ) : 0 ); ?></div>
  58                      </div>
  59                  </th>
  60                  <?php foreach ( $data['sets'] as $set_id => $set_data ) : ?>
  61                      <?php  reset( $data['sets'] );    if ( $set_id !== key($data['sets']) ) echo '<tr>'; ?>
  62                      <td class="set-name">
  63                          <strong><?php gp_link( gp_url_project( $set_data->project_path, gp_url_join( $locale->slug, $set_data->slug ) ), $set_data->name ); ?></strong>
  64                          <?php if ( $set_data->current_count && $set_data->current_count >= $set_data->all_count * 0.9 ):
  65                              $percent = floor( $set_data->current_count / $set_data->all_count * 100 );
  66                              ?>
  67                              <span class="bubble morethan90"><?php echo $percent; ?>%</span>
  68                          <?php endif;?>
  69                      </td>
  70                      <td class="stats translated"><?php gp_link( gp_url_project( $set_data->project_path, gp_url_join( $locale->slug, $set_data->slug ), array('filters[translated]' => 'yes', 'filters[status]' => 'current') ), absint( $set_data->current_count ) ); ?></td>
  71                      <td class="stats fuzzy"><?php gp_link( gp_url_project( $set_data->project_path, gp_url_join( $locale->slug, $set_data->slug ), array('filters[status]' => 'fuzzy' ) ), absint( $set_data->fuzzy_count ) ); ?></td>
  72                      <td class="stats untranslated"><?php gp_link( gp_url_project( $set_data->project_path, gp_url_join( $locale->slug, $set_data->slug ), array('filters[status]' => 'untranslated' ) ), absint( $set_data->all_count ) -  absint( $set_data->current_count ) ); ?></td>
  73                      <td class="stats waiting"><?php gp_link( gp_url_project( $set_data->project_path, gp_url_join( $locale->slug, $set_data->slug ), array('filters[translated]' => 'yes', 'filters[status]' => 'waiting') ), absint( $set_data->waiting_count ) ); ?></td>
  74                      </tr>
  75                  <?php endforeach; //sub project slugs ?>
  76                  </tr>
  77              <?php endforeach;  //sub projects ?>
  78              </tbody>
  79          </table>
  80      </div>
  81  <?php endforeach; //top projects ?>
  82  
  83      <p class="actionlist secondary">
  84          <?php gp_link( gp_url( '/projects' ), __( 'All projects', 'glotpress' ) ); ?>
  85      </p>
  86  
  87  <?php gp_tmpl_footer();


Generated: Tue Oct 22 01:01:57 2019 Cross-referenced by PHPXref 0.7.1