Skip to:
Content

bbPress.org

Changeset 6097


Ignore:
Timestamp:
09/13/2016 08:12:47 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Common: Improve title output strings for friendlier i18n.

Props @SergeyBiryukov. Fixes #2852.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/template.php

    r5951 r6097  
    26782678    } elseif ( bbp_is_single_user() ) {
    26792679
    2680         // User is viewing their own profile
    2681         if ( bbp_is_user_home() ) {
    2682             $new_title['text'] = esc_attr_x( 'Your', 'User viewing his/her own profile', 'bbpress' );
    2683 
    2684         // User is viewing someone else's profile (so use their display name)
    2685         } else {
    2686             $new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name );
    2687         }
     2680        // Is user viewing their own profile?
     2681        $is_user_home = bbp_is_user_home();
    26882682
    26892683        // User topics created
    26902684        if ( bbp_is_single_user_topics() ) {
    2691             $new_title['format'] = esc_attr__( "%s Topics",        'bbpress' );
    2692 
    2693         // User rueplies created
     2685            if ( true === $is_user_home ) {
     2686                $new_title['text'] = esc_attr__( 'Your Topics', 'bbpress' );
     2687            } else {
     2688                $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
     2689                /* translators: user's display name */
     2690                $new_title['format'] = esc_attr__( "%s's Topics", 'bbpress' );
     2691            }
     2692
     2693        // User replies created
    26942694        } elseif ( bbp_is_single_user_replies() ) {
    2695             $new_title['format'] = esc_attr__( "%s Replies",       'bbpress' );
     2695            if ( true === $is_user_home ) {
     2696                $new_title['text'] = esc_attr__( 'Your Replies', 'bbpress' );
     2697            } else {
     2698                $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
     2699                /* translators: user's display name */
     2700                $new_title['format'] = esc_attr__( "%s's Replies", 'bbpress' );
     2701            }
    26962702
    26972703        // User favorites
    26982704        } elseif ( bbp_is_favorites() ) {
    2699             $new_title['format'] = esc_attr__( "%s Favorites",     'bbpress' );
     2705            if ( true === $is_user_home ) {
     2706                $new_title['text'] = esc_attr__( 'Your Favorites', 'bbpress' );
     2707            } else {
     2708                $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
     2709                /* translators: user's display name */
     2710                $new_title['format'] = esc_attr__( "%s's Favorites", 'bbpress' );
     2711            }
    27002712
    27012713        // User subscriptions
    27022714        } elseif ( bbp_is_subscriptions() ) {
    2703             $new_title['format'] = esc_attr__( "%s Subscriptions", 'bbpress' );
     2715            if ( true === $is_user_home ) {
     2716                $new_title['text'] = esc_attr__( 'Your Subscriptions', 'bbpress' );
     2717            } else {
     2718                $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
     2719                /* translators: user's display name */
     2720                $new_title['format'] = esc_attr__( "%s's Subscriptions", 'bbpress' );
     2721            }
    27042722
    27052723        // User "home"
    27062724        } else {
    2707             $new_title['format'] = esc_attr__( "%s Profile",       'bbpress' );
     2725            if ( true === $is_user_home ) {
     2726                $new_title['text'] = esc_attr__( 'Your Profile', 'bbpress' );
     2727            } else {
     2728                $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name;
     2729                /* translators: user's display name */
     2730                $new_title['format'] = esc_attr__( "%s's Profile", 'bbpress' );
     2731            }
    27082732        }
    27092733
Note: See TracChangeset for help on using the changeset viewer.