Make WordPress Core

Changeset 35458


Ignore:
Timestamp:
10/30/2015 10:39:02 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Don't use <a> in translatable strings in theme-compat/sidebar.php.

Add translator comments.

Props ramiy.
Fixes #34503.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-compat/sidebar.php

    r27369 r35458  
    88 *
    99 */
    10 _deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
     10_deprecated_file(
     11        /* translators: %s: template name */
     12        sprintf( __( 'Theme without %s' ), basename( __FILE__ ) ),
     13        '3.0',
     14        null,
     15        /* translators: %s: template name */
     16        sprintf( __( 'Please include a %s template in your theme.' ), basename( __FILE__ ) )
     17);
    1118?>
    1219        <div id="sidebar" role="complementary">
    … …  
    2532
    2633                        <?php if ( is_404() || is_category() || is_day() || is_month() ||
    27                                                 is_year() || is_search() || is_paged() ) {
     34                                                is_year() || is_search() || is_paged() ) :
    2835                        ?> <li>
    2936
    30                         <?php /* If this is a 404 page */ if (is_404()) { ?>
    31                         <?php /* If this is a category archive */ } elseif (is_category()) { ?>
    32                         <p><?php printf(__('You are currently browsing the archives for the %s category.'), single_cat_title('', false)); ?></p>
     37                        <?php if ( is_404() ) : /* If this is a 404 page */ ?>
     38                        <?php elseif ( is_category() ) : /* If this is a category archive */ ?>
     39                                <p><?php /* translators: %s: category name */
     40                                        printf( __( 'You are currently browsing the archives for the %s category.' ),
     41                                                single_cat_title( '', false )
     42                                        );
     43                                ?></p>
    3344
    34                         <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    35                         <p><?php printf(__('You are currently browsing the <a href="%1$s/">%2$s</a> blog archives for the day %3$s.'), get_bloginfo('url'), get_bloginfo('name'), get_the_time(__('l, F jS, Y'))); ?></p>
     45                        <?php elseif ( is_day() ) : /* If this is a daily archive */ ?>
     46                                <p><?php /* translators: 1: site link, 2: archive date */
     47                                        printf( __( 'You are currently browsing the %1$s blog archives for the day %2$s.' ),
     48                                                sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     49                                                get_the_time( __( 'l, F jS, Y' ) )
     50                                        );
     51                                ?></p>
    3652
    37                         <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    38                         <p><?php printf(__('You are currently browsing the <a href="%1$s/">%2$s</a> blog archives for %3$s.'), get_bloginfo('url'), get_bloginfo('name'), get_the_time(__('F, Y'))); ?></p>
     53                        <?php elseif ( is_month() ) : /* If this is a monthly archive */ ?>
     54                                <p><?php /* translators: 1: site link, 2: archive month */
     55                                        printf( __( 'You are currently browsing the %1$s blog archives for %2$s.' ),
     56                                                sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     57                                                get_the_time( __( 'F, Y' ) )
     58                                        );
     59                                ?></p>
    3960
    40                         <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    41                         <p><?php printf(__('You are currently browsing the <a href="%1$s/">%2$s</a> blog archives for the year %3$s.'), get_bloginfo('url'), get_bloginfo('name'), get_the_time('Y')); ?></p>
     61                        <?php elseif ( is_year() ) : /* If this is a yearly archive */ ?>
     62                                <p><?php /* translators: 1: site link, 2: archive year */
     63                                        printf( __( 'You are currently browsing the %1$s blog archives for the year %2$s.' ),
     64                                                sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     65                                                get_the_time( 'Y' )
     66                                        );
     67                                ?></p>
    4268
    43                         <?php /* If this is a search result */ } elseif (is_search()) { ?>
    44                         <p><?php printf(__('You have searched the <a href="%1$s/">%2$s</a> blog archives for <strong>&#8216;%3$s&#8217;</strong>. If you are unable to find anything in these search results, you can try one of these links.'), get_bloginfo('url'), get_bloginfo('name'), esc_html( get_search_query() ) ); ?></p>
     69                        <?php elseif ( is_search() ) : /* If this is a search result */ ?>
     70                                <p><?php /* translators: 1: site link, 2: search query */
     71                                        printf( __( 'You have searched the %1$s blog archives for <strong>&#8216;%2$s&#8217;</strong>. If you are unable to find anything in these search results, you can try one of these links.' ),
     72                                                sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) ),
     73                                                esc_html( get_search_query() )
     74                                        );
     75                                ?></p>
    4576
    46                         <?php /* If this set is paginated */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    47                         <p><?php printf(__('You are currently browsing the <a href="%1$s/">%2$s</a> blog archives.'), get_bloginfo('url'), get_bloginfo('name')); ?></p>
     77                        <?php elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) : /* If this set is paginated */ ?>
     78                                <p><?php /* translators: %s: site link */
     79                                        printf( __( 'You are currently browsing the %s blog archives.' ),
     80                                                sprintf( '<a href="%1$s/">%2$s</a>', get_bloginfo( 'url' ), get_bloginfo( 'name' ) )
     81                                        );
     82                                ?></p>
    4883
    49                         <?php } ?>
     84                        <?php endif; ?>
    5085
    5186                        </li>
    52                 <?php }?>
     87                <?php endif; ?>
    5388                </ul>
    5489                <ul role="navigation">
    … …  
    6499                </ul>
    65100                <ul>
    66                         <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
     101                        <?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?>
    67102                                <?php wp_list_bookmarks(); ?>
    68103
    … …  
    79114                        <?php } ?>
    80115
    81                         <?php endif; ?>
     116                        <?php endif; /* ! dynamic_sidebar() */ ?>
    82117                </ul>
    83118        </div>
Note: See TracChangeset for help on using the changeset viewer.