Make WordPress Core

Changeset 18029


Ignore:
Timestamp:
05/25/2011 03:19:33 PM (13 years ago)
Author:
iandstewart
Message:

Twenty Eleven: make categories and tags i18n friendly; Props dimadin; Fixes #17531

Location:
trunk/wp-content/themes/twentyeleven
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/content-featured.php

    r17959 r18029  
    3535    <footer class="entry-meta">
    3636        <?php
    37             $tag_list = get_the_tag_list( '', ', ' );
     37            /* translators: used between list items, there is a space after the comma */
     38            $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    3839            if ( '' != $tag_list ) {
    3940                $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
     
    4344            printf(
    4445                $utility_text,
    45                 get_the_category_list( ', ' ),
     46                /* translators: used between list items, there is a space after the comma */
     47                get_the_category_list( __( ', ', 'twentyeleven' ) ),
    4648                $tag_list,
    4749                get_permalink(),
  • trunk/wp-content/themes/twentyeleven/content-gallery.php

    r17959 r18029  
    6666
    6767    <footer class="entry-meta">
    68         <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in', 'twentyeleven' ); ?></span> <?php the_category( ', ' ); ?></span>
    69         <?php the_tags( '<span class="sep"> | </span> <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged', 'twentyeleven' ) . '</span> ', ', ', '</span>' ); ?>
     68        <?php
     69            /* translators: used between list items, there is a space after the comma */
     70            $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     71            if ( $categories_list ):
     72        ?>
     73        <span class="cat-links">
     74            <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
     75            $show_sep = true; ?>
     76        </span>
     77        <?php endif; // End if categories ?>
     78        <?php
     79            /* translators: used between list items, there is a space after the comma */
     80            $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     81            if ( $tags_list ):
     82            if ( $show_sep ) : ?>
     83        <span class="sep"> | </span>
     84            <?php endif; // End if $show_sep ?>
     85        <span class="tag-links">
     86            <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
     87            $show_sep = true; ?>
     88        </span>
     89        <?php endif; // End if $tags_list ?>
    7090
    7191        <?php if ( comments_open() ) : ?>
     92        <?php if ( $show_sep ) : ?>
    7293        <span class="sep"> | </span>
     94        <?php endif; // End if $show_sep ?>
    7395        <span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    74         <?php endif; ?>
     96        <?php endif; // End if comments_open() ?>
    7597
    7698        <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
  • trunk/wp-content/themes/twentyeleven/content-image.php

    r17959 r18029  
    5151            </div><!-- .entry-meta -->
    5252            <div class="entry-meta">
    53                 <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyeleven' ); ?></span><?php the_category( ', ' ); ?></span>
    54                 <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged', 'twentyeleven' ) . '</span> ', ', ', '</span>' ); ?>
     53                <?php
     54                /* translators: used between list items, there is a space after the comma */
     55                    $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     56                    if ( $categories_list ):
     57                ?>
     58                <span class="cat-links">
     59                    <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
     60                </span>
     61                <?php endif; // End if categories ?>
     62                <?php
     63                    /* translators: used between list items, there is a space after the comma */
     64                    $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     65                    if ( $tags_list ): ?>
     66                <span class="tag-links">
     67                    <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
     68                </span>
     69                <?php endif; // End if $tags_list ?>
     70
    5571                <?php if ( comments_open() ) : ?>
    5672                <span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    57                 <?php endif; ?>
     73                <?php endif; // End if comments_open() ?>
    5874            </div><!-- .entry-meta -->
    5975            <?php endif; ?>
  • trunk/wp-content/themes/twentyeleven/content-quote.php

    r17959 r18029  
    5151        <footer class="entry-meta">
    5252            <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
    53             <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in', 'twentyeleven' ); ?></span> <?php the_category( ', ' ); ?></span>
    54             <?php the_tags( '<span class="sep"> | </span> <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged', 'twentyeleven' ) . '</span> ', ', ', '</span>' ); ?>
    55             <?php endif; ?>
     53            <?php
     54                /* translators: used between list items, there is a space after the comma */
     55                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     56                if ( $categories_list ):
     57            ?>
     58            <span class="cat-links">
     59                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
     60                $show_sep = true; ?>
     61            </span>
     62            <?php endif; // End if categories ?>
     63            <?php
     64                /* translators: used between list items, there is a space after the comma */
     65                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     66                if ( $tags_list ):
     67                if ( $show_sep ) : ?>
     68            <span class="sep"> | </span>
     69                <?php endif; // End if $show_sep ?>
     70            <span class="tag-links">
     71                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
     72                $show_sep = true; ?>
     73            </span>
     74            <?php endif; // End if $tags_list ?>
     75            <?php endif; // End if 'post' == $post->post_type ?>
    5676
    5777            <?php if ( comments_open() ) : ?>
     78            <?php if ( $show_sep ) : ?>
    5879            <span class="sep"> | </span>
     80            <?php endif; // End if $show_sep ?>
    5981            <span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    60             <?php endif; ?>
     82            <?php endif; // End if comments_open() ?>
    6183
    6284            <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
  • trunk/wp-content/themes/twentyeleven/content-single.php

    r17959 r18029  
    3434    <footer class="entry-meta">
    3535        <?php
    36             $tag_list = get_the_tag_list( '', ', ' );
     36            /* translators: used between list items, there is a space after the comma */
     37            $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    3738            if ( '' != $tag_list ) {
    3839                $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
     
    4243            printf(
    4344                $utility_text,
    44                 get_the_category_list( ', ' ),
     45                /* translators: used between list items, there is a space after the comma */
     46                get_the_category_list( __( ', ', 'twentyeleven' ) ),
    4547                $tag_list,
    4648                get_permalink(),
  • trunk/wp-content/themes/twentyeleven/content.php

    r17959 r18029  
    5555        <footer class="entry-meta">
    5656            <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
    57             <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in', 'twentyeleven' ); ?></span> <?php the_category( ', ' ); ?></span>
    58             <?php the_tags( '<span class="sep"> | </span> <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged', 'twentyeleven' ) . '</span> ', ', ', '</span>' ); ?>
    59             <?php endif; ?>
     57            <?php
     58                /* translators: used between list items, there is a space after the comma */
     59                $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
     60                if ( $categories_list ):
     61            ?>
     62            <span class="cat-links">
     63                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
     64                $show_sep = true; ?>
     65            </span>
     66            <?php endif; // End if categories ?>
     67            <?php
     68                /* translators: used between list items, there is a space after the comma */
     69                $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
     70                if ( $tags_list ):
     71                if ( $show_sep ) : ?>
     72            <span class="sep"> | </span>
     73                <?php endif; // End if $show_sep ?>
     74            <span class="tag-links">
     75                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
     76                $show_sep = true; ?>
     77            </span>
     78            <?php endif; // End if $tags_list ?>
     79            <?php endif; // End if 'post' == $post->post_type ?>
    6080
    6181            <?php if ( comments_open() ) : ?>
     82            <?php if ( $show_sep ) : ?>
    6283            <span class="sep"> | </span>
     84            <?php endif; // End if $show_sep ?>
    6385            <span class="comments-link"><?php comments_popup_link( __( '<span class="leave-reply">Leave a reply</span>', 'twentyeleven' ), __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    64             <?php endif; ?>
     86            <?php endif; // End if comments_open() ?>
    6587
    6688            <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
Note: See TracChangeset for help on using the changeset viewer.