Making WordPress.org


Ignore:
Timestamp:
04/15/2017 10:14:58 PM (9 years ago)
Author:
ocean90
Message:

WP i18n teams: Add locale managers to detail pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/views/locale-details.php

    r5160 r5344  
    1111    <ul id="locale-details">
    1212        <li>
    13             <strong><?php _e( 'Locale site:', 'wporg' ); ?></strong>
    14             <?php if ( $locale_data['rosetta_site_url'] ) : ?>
    15                 <a href="<?php echo esc_url( $locale_data['rosetta_site_url'] ); ?>"><?php echo parse_url( $locale_data['rosetta_site_url'], PHP_URL_HOST ); ?></a>
    16             <?php else : ?>
    17                 &mdash;
    18             <?php endif; ?>
    19         </li>
    20         <li>
    21             <strong><?php _e( 'Team site:', 'wporg' ); ?></strong>
    22             <?php if ( $locale_data['team_url'] ) : ?>
    23                 <a href="<?php echo esc_url( $locale_data['team_url'] ); ?>"><?php
    24                     $url = parse_url( $locale_data['team_url'] );
    25                     printf( '%s%s', $url['host'], $url['path'] );
    26                 ?></a>
    27             <?php else : ?>
    28                 &mdash;
    29             <?php endif; ?>
    30         </li>
    31         <li>
    32             <strong><?php _e( 'Forums:', 'wporg' ); ?></strong>
    33             <?php if ( $locale_data['forums_url'] ) : ?>
    34                 <a href="<?php echo esc_url( $locale_data['forums_url'] ); ?>"><?php
    35                     $url = parse_url( $locale_data['forums_url'] );
    36                     printf( '%s%s', $url['host'], $url['path'] );
    37                 ?></a>
    38             <?php else : ?>
     13            <strong><?php _e( 'Sites:', 'wporg' ); ?></strong>
     14            <?php
     15            if ( $locale_data['sites'] ) :
     16                echo implode( ', ', array_map( function( $site ) {
     17                    return sprintf(
     18                        '<a href="%s">%s (%s)</a>',
     19                        esc_url( $site->home ),
     20                        esc_html( $site->blogname ),
     21                        esc_html( $site->domain . $site->path )
     22                    );
     23                },  $locale_data['sites'] ) );
     24            else : ?>
    3925                &mdash;
    4026            <?php endif; ?>
     
    8066</div>
    8167
     68<?php if ( ! empty( $locale_data['locale_managers'] ) ) : ?>
     69    <h2><?php printf( __( 'Locale Managers (%s)', 'wporg' ), number_format_i18n( count( $locale_data['locale_managers'] ) ) ); ?></h2>
    8270
    83 <h2><?php printf( __( 'General Translation Editors (%s)', 'wporg' ), number_format_i18n( count( $locale_data['validators'] ) ) ); ?></h2>
     71    <ul class="validators">
     72        <?php foreach ( $locale_data['locale_managers'] as $locale_manager ) :
     73            ?>
     74            <li>
     75                <a class="profile" href="https://profiles.wordpress.org/<?php echo esc_attr( $locale_manager['nice_name'] ); ?>"><?php
     76                    echo get_avatar( $locale_manager['email'], 60 );
     77                    echo esc_html( $locale_manager['display_name'] );
     78                    ?></a>
     79                <?php
     80                if ( $locale_manager['slack'] ) {
     81                    printf( '<span class="user-slack">@%s on <a href="%s">Slack</a></span>', $locale_manager['slack'], 'https://make.wordpress.org/chat/' );
     82                }
     83                ?>
     84            </li>
     85        <?php endforeach; ?>
     86    </ul>
     87<?php endif; ?>
    8488
    85 <?php if ( empty( $locale_data['validators'] ) ) : ?>
    86     <p><?php
    87         /* translators: %s: language name in English */
    88         printf( __( '%s does not have General or Project translation editors yet.', 'wporg' ), $locale->english_name );
    89     ?></p>
    90 <?php else : ?>
     89<?php if ( ! empty( $locale_data['validators'] ) ) : ?>
     90    <h2><?php printf( __( 'General Translation Editors (%s)', 'wporg' ), number_format_i18n( count( $locale_data['validators'] ) ) ); ?></h2>
     91
    9192    <ul class="validators">
    9293        <?php foreach ( $locale_data['validators'] as $validator ) :
     
    106107    </ul>
    107108<?php endif; ?>
    108 
    109109
    110110<?php if ( ! empty( $locale_data['project_validators'] ) ) : ?>
     
    129129<?php endif; ?>
    130130
    131 <h2><?php printf( __( 'All Translation Contributors (%s)', 'wporg' ), number_format_i18n( count( $locale_data['translators'] ) ) ); ?></h2>
     131<?php if ( ! empty( $locale_data['translators'] ) ) : ?>
     132    <h2><?php printf( __( 'All Translation Contributors (%s)', 'wporg' ), number_format_i18n( count( $locale_data['translators'] ) ) ); ?></h2>
    132133
    133 <?php if ( empty( $locale_data['translators'] ) ) : ?>
    134     <p><?php printf( __( '%s does not have any translators yet.', 'wporg' ), $locale->english_name ); ?></p>
    135 <?php else :?>
    136134    <p>
    137135        <?php
     
    149147<?php endif; ?>
    150148
    151 <p class="alert alert-info" role="alert">
    152     <a href="https://translate.wordpress.org/locale/<?php echo esc_attr( $locale->slug ); ?>"><?php
     149<?php
     150$notice = sprintf(
     151    '%s <a href="https://translate.wordpress.org/locale/%s">%s</a>',
     152    __( 'Is this a language that you speak?', 'wporg' ),
     153    esc_attr( $locale->slug ),
     154    sprintf(
    153155        /* translators: %s: language name in English */
    154         printf( __( 'Is this a language that you speak? Join the WordPress translation team for %s!', 'wporg' ), $locale->english_name );
    155     ?></a>
    156 </p>
     156        __( 'Join the WordPress translation team for %s!', 'wporg' ),
     157        esc_html( $locale->english_name )
     158    )
     159);
     160echo do_shortcode( "[info]{$notice}[/info]" );
Note: See TracChangeset for help on using the changeset viewer.