Skip to:
Content

BuddyPress.org

Changeset 396


Ignore:
Timestamp:
10/23/2008 02:07:15 PM (17 years ago)
Author:
apeatling
Message:

merged nikolayb's language function changes into the core.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r394 r396  
    288288}
    289289
    290 function bp_my_or_name( $capitalize = true, $echo = true ) {
    291     global $bp;
    292    
    293     $my = __('my', 'buddypress');
     290function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) {
     291    global $bp;
    294292   
    295293    if ( $capitalize )
    296         $my = ucfirst($my);
     294        $youtext = ucfirst($youtext);
    297295   
    298296    if ( $bp['current_userid'] == $bp['loggedin_userid'] ) {
    299297        if ( $echo )
    300             echo $my;
     298            echo $youtext;
    301299        else
    302             return $my;
     300            return $youtext;
    303301    } else {
     302        $nametext = sprintf($nametext, $bp['current_fullname']);
    304303        if ( $echo )
    305             echo $bp['current_fullname'] . "'s";
     304            echo $nametext;
    306305        else
    307             return $bp['current_fullname'] . "'s";
    308     }
    309 }
    310 
    311 function bp_you_or_name( $capitalize = true, $echo = true ) {
    312     global $bp;
    313    
    314     $you = __('you haven\'t', 'buddypress');
    315    
    316     if ( $capitalize )
    317         $you = ucfirst($you);
    318    
    319     if ( $bp['current_userid'] == $bp['loggedin_userid'] ) {
    320         if ( $echo )
    321             echo $you;
    322         else
    323             return $you;
    324     } else {
    325         if ( $echo )
    326             echo $bp['current_fullname'] . " hasn't";
    327         else
    328             return $bp['current_fullname'] . " hasn't";
    329     }
    330 }
    331 
    332 function bp_your_or_name( $capitalize = true, $echo = true ) {
    333     global $bp;
    334    
    335     $your = __('your', 'buddypress');
    336    
    337     if ( $capitalize )
    338         $your = ucfirst($your);
    339    
    340     if ( $bp['current_userid'] == $bp['loggedin_userid'] ) {
    341         if ( $echo )
    342             echo $your;
    343         else
    344             return $your;
    345     } else {
    346         if ( $echo )
    347             echo $bp['current_fullname'] . "'s";
    348         else
    349             return $bp['current_fullname'] . "'s";
    350     }
    351 }
    352 
    353 function bp_your_or_their( $capitalize = false, $echo = false ) {
    354     global $bp;
    355    
    356     $your = __('your', 'buddypress');
    357     $their = __('their', 'buddypress');
    358    
    359     if ( $capitalize )
    360         $your = ucfirst($your);
    361    
    362     if ( $bp['current_userid'] == $bp['loggedin_userid'] ) {
    363         if ( $echo )
    364             echo $your;
    365         else
    366             return $your;
    367     } else {
    368         if ( $echo )
    369             echo $their;
    370         else
    371             return $their;
     306            return $nametext;
    372307    }
    373308}
  • trunk/bp-friends/bp-friends-templatetags.php

    r391 r396  
    345345?> 
    346346    <div class="info-group">
    347         <h4><?php bp_my_or_name() ?> <?php _e('Friends', 'buddypress') ?> (<?php echo BP_Friends_Friendship::total_friend_count() ?>)  <a href="<?php echo $bp['current_domain'] . $bp['friends']['slug'] ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
     347        <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?> (<?php echo BP_Friends_Friendship::total_friend_count() ?>)  <a href="<?php echo $bp['current_domain'] . $bp['friends']['slug'] ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
    348348       
    349349        <?php if ( $friend_ids ) { ?>
     
    358358        <?php } else { ?>
    359359            <div id="message" class="info">
    360                 <p><?php bp_you_or_name() ?> <?php _e('added any friend connections yet.', 'buddypress') ?></p>
     360                <p><?php bp_word_or_name( __( "You haven't added any friend connections yet.", 'buddypress' ), __( "%s hasn't created any friend connections yet.", 'buddypress' ) ) ?></p>
    361361            </div>
    362362        <?php } ?>
  • trunk/bp-groups/bp-groups-templatetags.php

    r391 r396  
    587587?> 
    588588    <div class="info-group">
    589         <h4><?php bp_my_or_name() ?> <?php _e('Groups', 'buddypress') ?> (<?php echo BP_Groups_Member::total_group_count() ?>) <a href="<?php echo $bp['current_domain'] . $bp['groups']['slug'] ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
     589        <h4><?php bp_word_or_name( __( "My Groups", 'buddypress' ), __( "%s's Groups", 'buddypress' ) ) ?> (<?php echo BP_Groups_Member::total_group_count() ?>) <a href="<?php echo $bp['current_domain'] . $bp['groups']['slug'] ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
    590590        <?php if ( $group_ids ) { ?>
    591591            <ul class="horiz-gallery">
     
    600600        <?php } else { ?>
    601601            <div id="message" class="info">
    602                 <p><?php bp_you_or_name() ?> <?php _e('joined any groups yet.', 'buddypress') ?></p>
     602                <p><?php bp_word_or_name( __( "You haven't oined any groups yet.", 'buddypress' ), __( "%s hasn't joined any groups yet.", 'buddypress' ) ) ?></p>
    603603            </div>
    604604        <?php } ?>
  • trunk/buddypress-theme/buddypress-member/activity/activity-list.php

    r395 r396  
    1515
    1616        <div id="message" class="info">
    17             <p><?php bp_you_or_name() ?> done anything recently.</p>
     17            <p><?php bp_word_or_name( __( "You haven't done anything recently.", 'buddypress' ), __( "%s hasn't done anything recently.", 'buddypress' ) ) ?></p>
    1818        </div>
    1919
  • trunk/buddypress-theme/buddypress-member/activity/just-me.php

    r395 r396  
    2020
    2121        <?php if ( function_exists('bp_activity_get_list') ) : ?>
    22             <?php bp_activity_get_list( bp_current_user_id(), bp_my_or_name( true, false ) . __(' Activity') ) ?>
     22            <?php bp_activity_get_list( bp_current_user_id(), bp_word_or_name( __( "My Activity", 'buddypress' ), __( "%s's Activity", 'buddypress' ), true, false ) ) ?>
    2323        <?php endif; ?>
    2424       
  • trunk/buddypress-theme/buddypress-member/blogs/my-blogs.php

    r395 r396  
    33
    44<div id="content">
    5     <h2><?php bp_my_or_name() ?> <?php _e('Blogs') ?></h2>
     5    <h2><?php bp_word_or_name( __( "My Blogs", 'buddypress' ), __( "%s's Blogs", 'buddypress' ) ) ?></h2>
    66    <?php do_action( 'template_notices' ) // (error/success feedback) ?>
    77
     
    1818
    1919        <div id="message" class="info">
    20             <p><?php bp_you_or_name() ?> <?php _e('created any blogs yet.'); ?> <?php bp_create_blog_link() ?> </p>
     20            <p><?php bp_word_or_name( __( "You haven't created any blogs yet.", 'buddypress' ), __( "%s hasn't created any blogs yet.", 'buddypress' ) ) ?> <?php bp_create_blog_link() ?> </p>
    2121        </div>
    2222
  • trunk/buddypress-theme/buddypress-member/blogs/recent-comments.php

    r395 r396  
    1919
    2020        <div id="message" class="info">
    21             <p><?php bp_you_or_name() ?> <?php _e('posted any comments yet!'); ?></p>
     21            <p><?php bp_word_or_name( __( "You haven't posted any comments yet.", 'buddypress' ), __( "%s hasn't posted any comments yet.", 'buddypress' ) ) ?></p>
    2222        </div>
    2323
  • trunk/buddypress-theme/buddypress-member/blogs/recent-posts.php

    r395 r396  
    1919
    2020        <div id="message" class="info">
    21             <p><?php bp_you_or_name() ?> <?php _e('made any posts yet!'); ?></p>
     21            <p><?php bp_word_or_name( __( "You haven't made any posts yet.", 'buddypress' ), __( "%s hasn't made any posts yet.", 'buddypress' ) ) ?></p>
    2222        </div>
    2323
  • trunk/buddypress-theme/buddypress-member/friends/index.php

    r395 r396  
    33
    44<div id="content">
    5     <h2><?php bp_my_or_name() ?> Friends</h2>
     5    <h2><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?></h2>
    66   
    77    <div class="left-menu">
     
    2929
    3030            <div id="message" class="info">
    31                 <p><?php bp_your_or_name() ?> friends list is currently empty.</p>
     31                <p><?php bp_word_or_name( __( "Your friends list is currently empty", 'buddypress' ), __( "%s's friends list is currently empty", 'buddypress' ) ) ?></p>
    3232            </div>
    3333
  • trunk/buddypress-theme/buddypress-member/groups/index.php

    r395 r396  
    44
    55<div id="content">
    6     <h2><?php bp_my_or_name() ?> <?php _e('Groups') ?></h2>
     6    <h2><?php bp_word_or_name( __( "My Groups", 'buddypress' ), __( "%s's Groups", 'buddypress' ) ) ?></h2>
    77   
    88    <div class="left-menu">
     
    3232
    3333            <div id="message" class="info">
    34                 <p><?php bp_you_or_name() ?> <?php _e('joined any groups yet.'); ?></p>
     34                <p><?php bp_word_or_name( __( "You haven't joined any groups yet.", 'buddypress' ), __( "%s hasn't joined any groups yet.", 'buddypress' ) ) ?></p>
    3535            </div>
    3636
  • trunk/buddypress-theme/buddypress-member/profile/index.php

    r395 r396  
    2626       
    2727        <?php if ( function_exists('bp_activity_get_list') ) : ?>
    28             <?php bp_activity_get_list( bp_current_user_id(), bp_my_or_name( true, false ) . __(' Activity'), 5 ) ?>
     28            <?php bp_activity_get_list( bp_current_user_id(), bp_word_or_name( __( "My Activity", 'buddypress' ), __( "%s's Activity", 'buddypress' ), true, false ), 5 ) ?>
    2929        <?php endif; ?>
    3030       
     
    3838
    3939        <?php if ( function_exists('bp_wire_get_post_list') ) : ?>
    40             <?php bp_wire_get_post_list( bp_current_user_id(), bp_my_or_name( true, false ) . ' Wire', 'No one has posted to ' . bp_your_or_name( false, false ) . ' wire yet.' ) ?>
     40            <?php bp_wire_get_post_list( bp_current_user_id(), bp_word_or_name( __( "My Wire", 'buddypress' ), __( "%s's Wire", 'buddypress' ), true, false ), bp_word_or_name( __( "No one has posted to your wire yet.", 'buddypress' ), __( "No one has posted to %s's wire yet.", 'buddypress' ), true, false ) ) ?>
    4141        <?php endif; ?>
    4242    </div>
  • trunk/buddypress-theme/buddypress-member/wire/latest.php

    r395 r396  
    2020       
    2121        <?php if ( function_exists('bp_wire_get_post_list') ) : ?>
    22             <?php bp_wire_get_post_list( bp_current_user_id(), bp_my_or_name( true, false ) . ' Wire', 'No one has posted to ' . bp_your_or_name( false, false ) . ' wire yet.' ) ?>
     22            <?php bp_wire_get_post_list( bp_current_user_id(), bp_word_or_name( __( "Your Wire", 'buddypress' ), __( "%s's Wire", 'buddypress' ), true, false ), bp_word_or_name( __( "No one has posted to your wire yet.", 'buddypress' ), __( "No one has posted to %s's wire yet.", 'buddypress' ), false, false ) ) ?>
    2323        <?php endif; ?>
    2424       
Note: See TracChangeset for help on using the changeset viewer.