Making WordPress.org

Ticket #4525: 4525.patch

File 4525.patch, 1.8 KB (added by ramiy, 4 years ago)

initial patch (not tested)

  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/projects-wp-plugins-language-packs.php

     
    4040</div>
    4141
    4242<div class="project-sub-page">
     43        <h3>Insights</h3>
     44        <p>General data about the plugin language pack.</p>
     45        <?php
     46        if ( isset( $language_packs->translations ) && $language_packs->translations ) {
     47                $all_versions = [];
     48                foreach ( $language_packs->translations as $language_pack ) {
     49                        array_push( $all_versions, $language_pack->version );
     50                }
     51                $count_versions = array_count_values( $all_versions );
     52                $total_packs = count( $all_versions );
     53                $not_updated_packs = $count_versions[ $project->version ];
     54                $updated_packs = $total_packs - $not_updated_packs;
     55                ?>
     56                <ul>
     57                        <li>Current plugin version: <strong><?php echo $project->version; ?></strong></li>
     58                        <li>The total number of language packs: <strong><?php echo $total_packs; ?></strong></li>
     59                        <li>The number of packs for older version: <strong><?php echo $not_updated_packs; ?></strong></li>
     60                        <li>The number of packs for the current version: <strong><?php echo $updated_packs; ?></strong></li>
     61                </ul>
     62                <?php
     63        } else {
     64                ?>
     65                <p>There are no language packs yet.</p>
     66                <?php
     67        }
     68        ?>
     69
    4370        <h3>Language Packs</h3>
    44 
    4571        <p>Language packs are installed automatically if they are available. Once a locale has reached the threshold for a package build it will be listed here. It also means that you don&#8217;t have to include this language in your plugin anymore.</p>
    4672
    4773        <?php