Making WordPress.org


Ignore:
Timestamp:
05/03/2015 09:50:53 AM (9 years ago)
Author:
ocean90
Message:

Forums Theme: Use a consistent textdomain and add load_theme_textdomain().

see #376.

File:
1 edited

Legend:

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

    r1521 r1535  
    55 * @package WPBBP
    66 */
     7
     8/**
     9 * Sets up theme defaults and registers support for various WordPress features.
     10 */
     11function wporg_support_setup() {
     12    load_theme_textdomain( 'wporg-forums' );
     13}
     14add_action( 'after_setup_theme', 'wporg_support_setup' );
    715
    816/**
     
    4250
    4351    // Separator
    44     $args['sep']             = is_rtl() ? __( '«', 'bbpress' ) : __( '»', 'bbpress' );
     52    $args['sep']             = is_rtl() ? __( '«', 'wporg-forums' ) : __( '»', 'wporg-forums' );
    4553    $args['pad_sep']         = 1;
    4654    $args['sep_before']      = '<span class="bbp-breadcrumb-sep">' ;
     
    5664    // Forum root
    5765    $args['include_root']    = true;
    58     $args['root_text']       = 'WordPress Support';
     66    $args['root_text']       = __( 'WordPress Support', 'wporg-forums' );
    5967
    6068    // Current
     
    7684 */
    7785function wporg_support_custom_views() {
    78     bbp_register_view( 'all-topics', __( 'All Topics' ), array( 'order' => 'DESC' ), false );
    79 //  bbp_register_view( 'support-forum-no', __( 'Not Resolved' ), array( 'post_status' => 'closed' ), false );
    80 //  bbp_register_view( 'taggedmodlook', __( 'Tagged modlook' ), array( 'topic-tag' => 'modlook' ) );
     86    bbp_register_view( 'all-topics', __( 'All Topics', 'wporg-forums' ), array( 'order' => 'DESC' ), false );
     87//  bbp_register_view( 'support-forum-no', __( 'Not Resolved', 'wporg-forums' ), array( 'post_status' => 'closed' ), false );
     88//  bbp_register_view( 'taggedmodlook', __( 'Tagged modlook', 'wporg-forums' ), array( 'topic-tag' => 'modlook' ) );
    8189}
    8290add_action( 'bbp_register_views', 'wporg_support_custom_views' );
     
    110118    <form role="search" method="get" id="searchform" action="">
    111119        <div>
    112             <h3><?php _e( 'Forum Search', 'bbporg'); ?></h3>
    113             <label class="screen-reader-text hidden" for="ts"><?php _e( 'Search for:', 'bbporg' ); ?></label>
     120            <h3><?php _e( 'Forum Search', 'wporg-forums' ); ?></h3>
     121            <label class="screen-reader-text hidden" for="ts"><?php _e( 'Search for:', 'wporg-forums' ); ?></label>
    114122            <input type="text" value="<?php echo bb_base_topic_search_query(); ?>" name="ts" id="ts" />
    115             <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'bbporg' ); ?>" />
     123            <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'wporg-forums' ); ?>" />
    116124        </div>
    117125    </form>
     
    125133    <form role="search" method="get" id="searchform" action="">
    126134        <div>
    127             <h3><?php _e( 'Reply Search', 'bbporg'); ?></h3>
    128             <label class="screen-reader-text hidden" for="rs"><?php _e( 'Search for:', 'bbporg' ); ?></label>
     135            <h3><?php _e( 'Reply Search', 'wporg-forums' ); ?></h3>
     136            <label class="screen-reader-text hidden" for="rs"><?php _e( 'Search for:', 'wporg-forums' ); ?></label>
    129137            <input type="text" value="<?php echo bb_base_reply_search_query(); ?>" name="rs" id="rs" />
    130             <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'bbporg' ); ?>" />
     138            <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'wporg-forums' ); ?>" />
    131139        </div>
    132140    </form>
     
    140148    <form role="search" method="get" id="searchform" action="">
    141149        <div>
    142             <h3><?php _e( 'Plugin Search', 'bbporg'); ?></h3>
    143             <label class="screen-reader-text hidden" for="ps"><?php _e( 'Search for:', 'bbporg' ); ?></label>
     150            <h3><?php _e( 'Plugin Search', 'wporg-forums' ); ?></h3>
     151            <label class="screen-reader-text hidden" for="ps"><?php _e( 'Search for:', 'wporg-forums' ); ?></label>
    144152            <input type="text" value="<?php echo bb_base_plugin_search_query(); ?>" name="ps" id="ts" />
    145             <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'bbporg' ); ?>" />
     153            <input class="button" type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'wporg-forums' ); ?>" />
    146154        </div>
    147155    </form>
     
    206214
    207215    // Singular/Plural
    208     $voice_count = sprintf( _n( '%s participant', '%s participants', $voice_count, 'bbpress' ), bbp_number_format( $voice_count ) );
     216    $voice_count = sprintf( _n( '%s participant', '%s participants', $voice_count, 'wporg-forums' ), bbp_number_format( $voice_count ) );
    209217    $last_reply  = bbp_get_topic_last_active_id( $topic_id );
    210218
     
    215223    <?php if ( !empty( $voice_count ) ) : ?><li class="voice-count"><?php echo $voice_count; ?></li><?php endif; ?>
    216224    <?php if ( !empty( $last_reply  ) ) : ?>
    217         <li class="topic-freshness-author"><?php printf( __( 'Last reply from: %s', 'bbporg' ), bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_reply, 'size' => '15' ) ) ); ?></li>
     225        <li class="topic-freshness-author"><?php printf( __( 'Last reply from: %s', 'wporg-forums' ), bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_reply, 'size' => '15' ) ) ); ?></li>
    218226    <?php endif; ?>
    219     <?php if ( !empty( $time_since  ) ) : ?><li class="topic-freshness-time"><?php printf( __( 'Last activity: %s', 'bbporg' ), $time_since ); ?></li><?php endif; ?>
     227    <?php if ( !empty( $time_since  ) ) : ?><li class="topic-freshness-time"><?php printf( __( 'Last activity: %s', 'wporg-forums' ), $time_since ); ?></li><?php endif; ?>
    220228    <?php if ( is_user_logged_in() ) : ?>
    221229        <?php $_topic_id = bbp_is_reply_edit() ? bbp_get_reply_topic_id() : $topic_id; ?>
     
    240248    // Has replies
    241249    if ( !empty( $reply_count ) ) {
    242         $reply_text = sprintf( _n( '%s reply', '%s replies', $reply_count, 'bbpress' ), bbp_number_format( $reply_count ) );
     250        $reply_text = sprintf( _n( '%s reply', '%s replies', $reply_count, 'wporg-forums' ), bbp_number_format( $reply_count ) );
    243251    }
    244252
     
    250258    // Forum has no last active data
    251259    } else {
    252         $topic_text      = sprintf( _n( '%s topic', '%s topics', $topic_count, 'bbpress' ), bbp_number_format( $topic_count ) );
     260        $topic_text      = sprintf( _n( '%s topic', '%s topics', $topic_count, 'wporg-forums' ), bbp_number_format( $topic_count ) );
    253261    }
    254262    ?>
     
    258266    <?php if ( !empty( $reply_count ) ) : ?><li class="reply-count"><?php echo $reply_text; ?></li><?php endif; ?>
    259267    <?php if ( !empty( $last_active  ) ) : ?>
    260         <li class="forum-freshness-author"><?php printf( __( 'Last post by: %s', 'bbporg' ), bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_active ) ) ); ?></li>
     268        <li class="forum-freshness-author"><?php printf( __( 'Last post by: %s', 'wporg-forums' ), bbp_get_author_link( array( 'type' => 'name', 'post_id' => $last_active ) ) ); ?></li>
    261269    <?php endif; ?>
    262     <?php if ( !empty( $time_since  ) ) : ?><li class="forum-freshness-time"><?php printf( __( 'Last activity: %s', 'bbporg' ), $time_since ); ?></li><?php endif; ?>
     270    <?php if ( !empty( $time_since  ) ) : ?><li class="forum-freshness-time"><?php printf( __( 'Last activity: %s', 'wporg-forums' ), $time_since ); ?></li><?php endif; ?>
    263271    <?php if ( is_user_logged_in() ) : ?>
    264272        <li class="forum-subscribe"><?php bbp_forum_subscription_link( array( 'forum_id' => $forum_id ) ); ?></li>
Note: See TracChangeset for help on using the changeset viewer.