Making WordPress.org

Changeset 1374


Ignore:
Timestamp:
03/04/2015 03:28:36 AM (11 years ago)
Author:
obenland
Message:

WP.org Themes: Add a plural form when a theme has ratings.

Fixes #886.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r1368 r1374  
    247247        $theme->description = wp_kses( $theme->description, $themes_allowedtags );
    248248        $theme->downloaded  = number_format_i18n( $theme->downloaded );
     249        $theme->rating_text = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
    249250        $theme->num_ratings = number_format_i18n( $theme->num_ratings );
    250251        $theme->preview_url = set_url_scheme( $theme->preview_url );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php

    r1336 r1374  
    2222                                                <span class="five"></span>
    2323
    24                                                 <# if ( data.num_ratings ) { #>
    25                                                 <small class="ratings"><?php printf( __( '(based on %s ratings).', 'wporg-themes' ), '{{ data.num_ratings }}' ); ?></small>
     24                                                <# if ( data.num_ratings > 0 ) { #>
     25                                                <small class="ratings">{{ data.rating_text }}</small>
    2626                                                <# } else { #>
    2727                                                <small class="ratings"><?php _e( 'No ratings.' ); ?></small>
Note: See TracChangeset for help on using the changeset viewer.