Making WordPress.org


Ignore:
Timestamp:
06/14/2018 10:02:26 AM (8 years ago)
Author:
obenland
Message:

BB Base: i18n improvements.

Updates remaining strings to be translatable.

See #2102.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/attachment.php

    r442 r7305  
    1 <?php get_header(); ?>
    2 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    3 <?php $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800)); // This also populates the iconsize for the next line ?>
    4 <?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
    5                         <div class="post" id="post-<?php the_ID(); ?>">
    6                                 <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
    7                                 <label class="date"><?php the_time('F jS, Y') ?></label>
    8                                 <p class="<?php echo esc_attr( $classname ); ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p>
    9 <?php the_content(__('Check it out!')); ?>
    10 <?php wp_link_pages(array('before' => 'Pages: ', 'after' => '', 'next_or_number' => 'number')); ?>
    11                                 <p class="postmeta">
    12                                         This entry was posted on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?> and is filed under <?php the_category(', ') ?>.
    13                                         You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed.
    14 <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    15                                         // Both Comments and Pings are open ?>
    16                                         You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    17 <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    18                                         // Only Pings are Open ?>
    19                                         Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    20 <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    21                                         // Comments are open, Pings are not ?>
    22                                         You can skip to the end and leave a response. Pinging is currently not allowed.
    23 <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    24                                         // Neither Comments, nor Pings are open ?>
    25                                         Both comments and pings are currently closed.
    26 <?php } edit_post_link('Edit this entry.','',''); ?>
    27                                 </p>
    28                         </div>
    29 <?php comments_template(); ?>
     1<?php
     2get_header();
     3if ( have_posts() ) :
     4        while ( have_posts() ) :
     5                the_post();
    306
    31 <?php endwhile; else: ?>
    32                         <h1>Whoops!</h1>
    33                         <p class="error"><?php _e("Sorry friend, there's no attachments for you to see here."); ?></p>
    34 <?php endif; ?>
    35 <?php get_footer(); ?>
     7                // This also populates the iconsize for the next line
     8                $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800));
     9                $_post = &get_post($post->ID);
     10                $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially
     11                ?>
     12
     13                <div class="post" id="post-<?php the_ID(); ?>">
     14                        <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf( esc_attr__( 'Permanent Link to %s', 'bborg' ), the_title_attribute( [ 'echo' => false ] ) ); ?>"><?php the_title(); ?></a></h1>
     15                        <label class="date"><?php the_time( 'F jS, Y' ); ?></label>
     16                        <p class="<?php echo esc_attr( $classname ); ?>"><?php echo $attachment_link; ?><br /><?php echo basename($post->guid); ?></p>
     17                        <?php
     18                                the_content( __( 'Check it out!', 'bborg' ) );
     19                                wp_link_pages( array(
     20                                        'before' => __( 'Pages: ', 'bborg' ),
     21                                        'after' => '',
     22                                        'next_or_number' => 'number',
     23                                ) );
     24                        ?>
     25                        <p class="postmeta">
     26                                <?php
     27                                printf(
     28                                        /* translators: 1: Date; 2: Time; 3: Category list; 4: Comment feed URL. */
     29                                        wp_kses_post( __( 'This entry was posted on %1$s at %2$s and is filed under %3$s. You can follow any responses to this entry through the <a href="%4$s">RSS 2.0</a> feed.', 'bborg' ) ),
     30                                        get_the_time( 'l, F jS, Y' ),
     31                                        get_the_time(),
     32                                        get_the_category_list(', '),
     33                                        get_post_comments_feed_link()
     34                                );
     35
     36                                if ( 'open' == $post->comment_status && 'open' == $post->ping_status ) :
     37                                        // Both Comments and Pings are open.
     38                                        printf( wp_kses_post( __( 'You can <a href="#respond">leave a response</a>, or <a href="%s" rel="trackback">trackback</a> from your own site.', 'bborg' ) ), esc_url( get_trackback_url() ) );
     39                                elseif ( 'open' != $post->comment_status && 'open' == $post->ping_status ) :
     40                                        // Only Pings are Open
     41                                        printf( wp_kses_post( __( 'Responses are currently closed, but you can <a href="%s" rel="trackback">trackback</a> from your own site.', 'bborg' ) ), esc_url( get_trackback_url() ) );
     42                                elseif ( 'open' == $post-> comment_status && 'open' != $post->ping_status ) :
     43                                        // Comments are open, Pings are not
     44                                        esc_html_e( 'You can skip to the end and leave a response. Pinging is currently not allowed.', 'bborg' );
     45                                elseif ( 'open' != $post-> comment_status && 'open' != $post->ping_status ) :
     46                                        // Neither Comments, nor Pings are open
     47                                        esc_html_e( 'Both comments and pings are currently closed.', 'bborg' );
     48                                endif;
     49                                edit_post_link('Edit this entry.','','');
     50                                ?>
     51                        </p>
     52                </div>
     53
     54        <?php
     55        comments_template();
     56        endwhile;
     57else:
     58?>
     59        <h1><?php esc_html_e('Whoops!', 'bborg' ); ?></h1>
     60        <p class="error"><?php esc_html_e('Sorry friend, there&#8217;s no attachments for you to see here.', 'bborg' ); ?></p>
     61<?php
     62endif;
     63get_footer();
Note: See TracChangeset for help on using the changeset viewer.