Skip to:
Content

BuddyPress.org

Changeset 12791


Ignore:
Timestamp:
11/19/2020 12:33:58 PM (10 months ago)
Author:
imath
Message:

i18n: improve translator comments for the "Active %s" string

Make sure the same translator comment is used for every occurrences of this string.

Fixes #8398

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-template.php

    r12784 r12791  
    639639        if ( true === $r['active_format'] ) {
    640640            /* translators: %s: human time diff of the last time the site was active. */
    641             $r['active_format'] = _x( 'active %s', 'last time the site was active', 'buddypress' );
     641            $r['active_format'] = _x( 'Active %s', 'last time the site was active', 'buddypress' );
    642642        }
    643643
  • trunk/src/bp-core/bp-core-functions.php

    r12776 r12791  
    15761576 *
    15771577 * @param int|string $last_activity_date The date of last activity.
    1578  * @param string     $string             A sprintf()-able statement of the form 'active %s'.
     1578 * @param string     $string             A sprintf()-able statement of the form 'Active %s'.
    15791579 * @return string $last_active A string of the form '3 years ago'.
    15801580 */
     
    15981598     * @param string $last_active        Last activity string based on time since date given.
    15991599     * @param string $last_activity_date The date of last activity.
    1600      * @param string $string             A sprintf()-able statement of the form 'active %s'.
     1600     * @param string $string             A sprintf()-able statement of the form 'Active %s'.
    16011601     */
    16021602    return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r12754 r12791  
    206206
    207207        /* translators: %s: human time diff of the last time the user was active on the site. */
    208         $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), _x( 'active %s', 'last time the user was active', 'buddypress' ) );
     208        $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), _x( 'Active %s', 'last time the user was active', 'buddypress' ) );
    209209    }
    210210
  • trunk/src/bp-groups/bp-groups-blocks.php

    r12757 r12791  
    304304                '<time datetime="%1$s">%2$s</time>',
    305305                esc_attr( bp_core_get_iso8601_date( $group->last_activity ) ),
    306                 /* translators: %s: a human time diff. */
     306                /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    307307                sprintf( esc_html__( 'Active %s', 'buddypress' ), bp_get_group_last_active( $group ) )
    308308            );
  • trunk/src/bp-groups/bp-groups-widgets.php

    r12590 r12791  
    7777                            <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
    7878                                <?php
    79                                 /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    80                                 printf( _x( 'active %s', 'last time the group was active', 'buddypress' ), bp_get_group_last_active() );
     79                                /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     80                                printf( _x( 'Active %s', 'last time the group was active', 'buddypress' ), bp_get_group_last_active() );
    8181                                ?>
    8282                            </span>
  • trunk/src/bp-groups/classes/class-bp-groups-invite-template.php

    r12590 r12791  
    276276        $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}'>{$this->invite->user->fullname}</a>";
    277277
    278         /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    279         $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'active %s', 'buddypress' ) );
     278        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     279        $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'Active %s', 'buddypress' ) );
    280280
    281281        if ( bp_is_active( 'groups' ) ) {
  • trunk/src/bp-groups/classes/class-bp-groups-widget.php

    r12590 r12791  
    150150                                        bp_group_member_count();
    151151                                    } else {
    152                                         /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    153                                         printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
     152                                        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     153                                        printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
    154154                                    }
    155155                                ?>
  • trunk/src/bp-members/bp-members-blocks.php

    r12757 r12791  
    333333                    '<time datetime="%1$s">%2$s</time>',
    334334                    esc_attr( bp_core_get_iso8601_date( $member->last_activity ) ),
    335                     /* translators: %s: a human time diff. */
     335                    /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    336336                    sprintf( esc_html__( 'Active %s', 'buddypress' ), bp_core_time_since( $member->last_activity ) )
    337337                );
  • trunk/src/bp-members/bp-members-template.php

    r12745 r12791  
    956956        // Backwards compatibility for anyone forcing a 'true' active_format.
    957957        if ( true === $r['active_format'] ) {
    958             $r['active_format'] = __( 'active %s', 'buddypress' );
     958            /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     959            $r['active_format'] = __( 'Active %s', 'buddypress' );
    959960        }
    960961
     
    16871688    function bp_get_last_activity( $user_id = 0 ) {
    16881689
    1689         if ( empty( $user_id ) )
     1690        if ( empty( $user_id ) ) {
    16901691            $user_id = bp_displayed_user_id();
    1691 
    1692         $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('active %s', 'buddypress') );
     1692        }
     1693
     1694        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     1695        $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('Active %s', 'buddypress') );
    16931696
    16941697        /**
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php

    r12082 r12791  
    6565            <div class="item">
    6666                <div class="item-title"><?php bp_group_link(); ?></div>
    67                 <div class="item-meta"><span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div>
     67                <div class="item-meta">
     68                    <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
     69                        <?php
     70                        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     71                        printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
     72                        ?>
     73                    </span>
     74                </div>
    6875
    6976                <div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php

    r12082 r12791  
    6161
    6262                <span class="highlight"><?php bp_group_type(); ?></span>
    63                 <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
     63                <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
     64                    <?php
     65                    /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     66                    printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
     67                    ?>
     68                </span>
    6469
    6570                <?php bp_group_description(); ?>
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php

    r12082 r12791  
    7070<div id="item-header-content">
    7171    <span class="highlight"><?php bp_group_type(); ?></span>
    72     <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
     72    <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
     73        <?php
     74        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
     75        printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
     76        ?>
     77    </span>
    7378
    7479    <?php
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php

    r12789 r12791  
    4545                                <?php
    4646                                    printf(
    47                                         /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
     47                                        /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    4848                                        esc_html__( 'Active %s', 'buddypress' ),
    4949                                        sprintf(
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php

    r12789 r12791  
    3232                    <?php
    3333                        printf(
    34                             /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
     34                            /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    3535                            esc_html__( 'Active %s', 'buddypress' ),
    3636                            sprintf(
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/single/group-header.php

    r12789 r12791  
    2929        <?php
    3030            printf(
    31                 /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
     31                /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
    3232                esc_html__( 'Active %s', 'buddypress' ),
    3333                sprintf(
  • trunk/tests/phpunit/testcases/blogs/template.php

    r12779 r12791  
    1717        $blogs_template->blog->last_activity = $time;
    1818
    19         $this->assertEquals( bp_core_get_last_activity( $time, __( 'active %s', 'buddypress' ) ), bp_get_blog_last_active() );
     19        $this->assertEquals( bp_core_get_last_activity( $time, __( 'Active %s', 'buddypress' ) ), bp_get_blog_last_active() );
    2020
    2121        $blogs_template->blog = null;
     
    3434        $blogs_template->blog->last_activity = $time;
    3535
    36         $this->assertEquals( bp_core_get_last_activity( $time, __( 'active %s', 'buddypress' ) ), bp_get_blog_last_active( array( 'active_format' => true, ) ) );
     36        $this->assertEquals( bp_core_get_last_activity( $time, __( 'Active %s', 'buddypress' ) ), bp_get_blog_last_active( array( 'active_format' => true, ) ) );
    3737
    3838        $blogs_template->blog = null;
  • trunk/tests/phpunit/testcases/members/template.php

    r12692 r12791  
    235235        $members_template->member->last_activity = $time;
    236236
    237         $this->assertEquals( bp_core_get_last_activity( $time, __( 'active %s', 'buddypress' ) ), bp_get_member_last_active() );
     237        $this->assertEquals( bp_core_get_last_activity( $time, __( 'Active %s', 'buddypress' ) ), bp_get_member_last_active() );
    238238    }
    239239
     
    250250        $members_template->member->last_activity = $time;
    251251
    252         $this->assertEquals( bp_core_get_last_activity( $time, __( 'active %s', 'buddypress' ) ), bp_get_member_last_active( array( 'active_format' => true, ) ) );
     252        $this->assertEquals( bp_core_get_last_activity( $time, __( 'Active %s', 'buddypress' ) ), bp_get_member_last_active( array( 'active_format' => true, ) ) );
    253253    }
    254254
Note: See TracChangeset for help on using the changeset viewer.