Making WordPress.org

Changeset 5372


Ignore:
Timestamp:
04/19/2017 07:28:27 PM (7 years ago)
Author:
ocean90
Message:

Plugin Directory: Use _n() for "translated into these locales" string.

Props SergeyBiryukov.
Fixes #2694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-developers.php

    r5371 r5372  
    1818        $slug   = $post->post_name;
    1919        $title  = get_the_title( $post );
    20         $output = '<div class="plugin-contributors"><p>' . sprintf( __( '%s is open source software. The following people have contributed to this plugin.', 'wporg-plugins' ), $title ) . '</p>';
     20        $output = '<div class="plugin-contributors"><p>' . sprintf(
     21            /* translators: %s: plugin name */
     22            __( '%s is open source software. The following people have contributed to this plugin.', 'wporg-plugins' ),
     23            $title
     24        ) . '</p>';
    2125
    2226        ob_start();
     
    5256            }, $sites ) );
    5357
    54             /* Translators: 1: Plugin name; 2: Number of locales; 3: List of locales; */
    55             $output .= sprintf( '%1$s has been translated into these %2$d locales: %3$s.', $title, count( $locales ), $locales_list ) . ' ';
     58            $locales_count = count( $sites );
     59
     60            if ( 1 === $locales_count ) {
     61                $output .= sprintf(
     62                    /* translators: 1: plugin name, 2: locale name */
     63                    __( '%1$s has been translated into %2$s.' ),
     64                    $title,
     65                    $locales_list
     66                ) . ' ';
     67            } else {
     68                $output .= sprintf(
     69                    /* translators: 1: plugin name, 2: number of locales, 3: list of locales */
     70                    _n(
     71                        '%1$s has been translated into these %2$d locales: %3$s.',
     72                        '%1$s has been translated into these %2$d locales: %3$s.',
     73                        $locales_count
     74                    ),
     75                    $title,
     76                    $locales_count,
     77                    $locales_list
     78                ) . ' ';
     79            }
     80
    5681            $output .= sprintf(
    57                 /* Translators: URL to translator view; */
     82                /* translators: URL to translator view */
    5883                __( 'Thank you to <a href="%s">the translators</a> for their contributions.', 'wporg-plugins' ),
    5984                esc_url( "https://translate.wordpress.org/projects/wp-plugins/{$slug}/contributors" )
     
    6287        }
    6388
    64         /* Translators: 1: GlotPress URL; 2: Plugin name; */
     89        /* translators: 1: GlotPress URL, 2: plugin name */
    6590        $output .= '<p>' . sprintf(
    6691            __( '<a href="%1$s">Translate %2$s into your language.</a>', 'wporg-plugins' ),
     
    80105
    81106            $output .= '<p>' . sprintf(
    82                 /* Translators: 1: Trac URL; 2: SVN repository URL, 3: Development log URL; 4: RSS URL; 5: Email subscription URL; */
     107                /* translators: 1: Trac URL, 2: SVN repository URL, 3: development log URL; 4: RSS URL; 5: email subscription UR; */
    83108                __( '<a href="%1$s">Browse the code</a>, check out the <a href="%2$s">SVN repository</a>, or subscribe to the <a href="%3$s">development log</a> by <a href="%4$s">email</a> or <a href="%5$s">RSS</a>.', 'wporg-plugins' ),
    84109                esc_url( "https://plugins.trac.wordpress.org/browser/{$slug}/" ),
     
    90115        } else {
    91116            $output .= '<p>' . sprintf(
    92                 /* Translators: 1: Trac URL; 2: Development log URL; 3: RSS URL; */
     117                /* translators: 1: Trac URL; 2: development log URL, 3: RSS URL */
    93118                __( '<a href="%1$s">Browse the code</a> or subscribe to the <a href="%2$s">development log</a> by <a href="%3$s">RSS</a>.', 'wporg-plugins' ),
    94119                esc_url( "https://plugins.trac.wordpress.org/browser/{$slug}/" ),
Note: See TracChangeset for help on using the changeset viewer.