Making WordPress.org


Ignore:
Timestamp:
01/26/2016 11:41:27 PM (11 years ago)
Author:
coffee2code
Message:

W.org Showcase: Pass all strings through i18n functions.

Props ramiy, coffee2code.
Fixes #1507.

File:
1 edited

Legend:

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

    r2077 r2376  
    7070        global $post;
    7171
    72         echo '<h4>Flavor</h4>
    73                 <ul id="flavors">';
     72        echo '<h4>' . __( 'Flavor', 'wporg-showcase' ). '</h4>';
     73        echo '<ul id="flavors">';
    7474
    7575        $flavors = array( 'WordPress.org', 'WordPress.com', 'WordPress.com VIP', 'WordPress MS' );
     
    8484
    8585        if ( in_category( 'BuddyPress' ) ) {
    86                 echo '<li class="flavor-used"><img src="' . get_template_directory_uri() . '/images/flavor-bp.png" /> BuddyPress</li>';
    87         } else {
    88                 echo '<li><img src="' . get_template_directory_uri() . '/images/flavor-bp2.png" /> BuddyPress</li>';
     86                echo '<li class="flavor-used"><img src="' . get_template_directory_uri() . '/images/flavor-bp.png" /> ' . __( 'BuddyPress', 'wporg-showcase' ). '</li>';
     87        } else {
     88                echo '<li><img src="' . get_template_directory_uri() . '/images/flavor-bp2.png" /> ' . __( 'BuddyPress', 'wporg-showcase' ). '</li>';
    8989        }
    9090
     
    9494function blockquote_style( $content ) {
    9595        if ( is_single() )
    96                 $content = str_replace( '</blockquote>', '<cite>Source: <a href="http://' . get_site_domain( false, false ) . '">' . get_site_domain( false, false, true ) . '</a></cite><div class="clear"></div></blockquote>', $content );
     96                $content = str_replace( '</blockquote>', '<cite>' . __( 'Source:', 'wporg-showcase' ). ' <a href="http://' . get_site_domain( false, false ) . '">' . get_site_domain( false, false, true ) . '</a></cite><div class="clear"></div></blockquote>', $content );
    9797
    9898        return $content;
     
    120120        $tags = get_terms( 'post_tag', $args );
    121121
    122         $out = '<h4>Browse Popular Tags</h4>';
     122        $out = '<h4>' . __( 'Browse Popular Tags', 'wporg-showcase' ). '</h4>';
    123123        $out .= '<ul class="submenu wpsc-popular-tags">';
    124124
     
    139139function breadcrumb() { ?>
    140140
    141         <h3><a href="<?php echo home_url( '/' ); ?>" title="Showcase">Showcase</a>
     141        <h3><a href="<?php echo home_url( '/' ); ?>" title="<?php esc_attr_e( 'Showcase', 'wporg-showcase' ); ?>"><?php _e( 'Showcase', 'wporg-showcase' ); ?></a>
    142142
    143143                <?php if ( is_search() ) : ?>
    144                         &raquo; Search for: <?php the_search_query(); ?>
     144                        <?php printf( __( '&raquo; Search for: %s', 'wporg-showcase' ), get_search_query() ); ?>
    145145                <?php elseif ( strstr( $_SERVER['REQUEST_URI'], '/showcase/archives' ) ) : ?>
    146                         &raquo; Archives
     146                        <?php _e( '&raquo; Archives', 'wporg-showcase' ); ?>
    147147                <?php else : ?>
    148148                        <?php if ( is_category() ) : ?>
    149                                 &raquo; Flavor
     149                                <?php _e( '&raquo; Flavor', 'wporg-showcase' ); ?>
    150150                        <?php elseif ( is_tag() ) : ?>
    151                                 &raquo; Tag
     151                                <?php _e( '&raquo; Tag', 'wporg-showcase' ); ?>
    152152                        <?php endif; // is_category ?>
    153153
    154                         &raquo; <?php echo wp_get_document_title(); ?>
     154                        <?php printf( __( '&raquo; %s', 'wporg-showcase' ), wp_get_document_title() ); ?>
    155155                <?php endif; // is_search ?>
    156156
     
    161161function sc_feed_author( $author ) {
    162162        if ( is_feed() )
    163                 $author = 'WordPress Showcase';
     163                $author = _x( 'WordPress Showcase', 'Feed Author', 'wporg-showcase' );
    164164
    165165        return $author;
     
    175175                foreach ( $posttags as $tag ) {
    176176                        if ( $tag->count > 1 && !is_tag($tag->slug) ) {
    177                                 $tag_link = '<a href="' . get_term_link($tag, 'post_tag') . '" rel="tag">' . $tag->name . ' (' . $tag->count . ')</a>';
     177                                $tag_link = '<a href="' . get_term_link($tag, 'post_tag') . '" rel="tag">' . sprintf( _x( '%1$s (%2$s)', 'Tag name (tag count)', 'wporg-showcase' ), $tag->name, $tag->count ) . '</a>';
    178178                        } else {
    179179                                $tag_link = $tag->name;
     
    249249        } elseif ( is_category() ) {
    250250                // Prepend 'Flavor: ' to category document titles.
    251                 $parts['title'] = 'Flavor: ' . $parts['title'];
     251                $parts['title'] = sprintf( __( 'Flavor: %s', 'wporg-showcase' ) . $parts['title'] );
    252252        } elseif ( is_tag() ) {
    253253                // Prepend 'Tag: ' to tag document titles.
    254                 $parts['title'] = 'Tag: ' . $parts['title'];
     254                $parts['title'] = sprintf( __( 'Tag: %s', 'wporg-showcase' ) . $parts['title'] );
    255255        }
    256256
Note: See TracChangeset for help on using the changeset viewer.