Skip to:
Content

BuddyPress.org

Changeset 14059


Ignore:
Timestamp:
10/25/2024 12:38:29 AM (7 months ago)
Author:
imath
Message:

Avoid WP 6.7 notice about using translatable strings too early

Use a "raw" name instead of a "translatable" name for the BP_Component's & BP_Theme_Compat's name properties.

Props boonebgorges.

See #9247 (trunk)
Closes https://github.com/buddypress/buddypress/pull/391

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/developer/components/build-component.md

    r14038 r14059  
    4848            'custom',
    4949
    50             // Your component Name.
    51             __( 'Custom component', 'custom-text-domain' ),
     50            // The raw name for your component. Do not use translatable strings here.
     51            'Custom component',
    5252
    5353            /*
  • trunk/src/bp-activity/classes/class-bp-activity-component.php

    r14026 r14059  
    2929        parent::start(
    3030            'activity',
    31             __( 'Activity Streams', 'buddypress' ),
     31            'Activity Streams',
    3232            buddypress()->plugin_dir,
    3333            array(
  • trunk/src/bp-blogs/classes/class-bp-blogs-component.php

    r14026 r14059  
    3131        parent::start(
    3232            'blogs',
    33             __( 'Site Directory', 'buddypress' ),
     33            'Site Directory',
    3434            buddypress()->plugin_dir,
    3535            array(
  • trunk/src/bp-core/classes/class-bp-component.php

    r14026 r14059  
    3030
    3131    /**
    32      * Translatable name for the component.
     32     * Raw name for the component.
     33     *
     34     * Do not use translatable strings here as this part is set before WP's `init` hook.
     35     *
     36     * @since 1.5.0
     37     * @since 14.3.0 Changed the variable inline documentation summary and added a description.
    3338     *
    3439     * @internal
     
    245250     * @since 2.3.0 Added $params['features'] as a configurable value.
    246251     * @since 2.4.0 Added $params['search_query_arg'] as a configurable value.
     252     * @since 14.3.0 Changed the `$name` parameter's description.
    247253     *
    248254     * @param string $id   Unique ID. Letters, numbers, and underscores only.
    249      * @param string $name Unique name. This should be a translatable name, e.g. __( 'Groups', 'buddypress' ).
     255     * @param string $name Unique raw name for the component (do not use translatable strings).
    250256     * @param string $path The file path for the component's files. Used by {@link BP_Component::includes()}.
    251257     * @param array  $params {
  • trunk/src/bp-core/classes/class-bp-core.php

    r14029 r14059  
    2929        parent::start(
    3030            'core',
    31             __( 'BuddyPress Core', 'buddypress' ),
     31            'BuddyPress Core',
    3232            buddypress()->plugin_dir
    3333        );
  • trunk/src/bp-core/classes/class-bp-theme-compat.php

    r13893 r14059  
    1919 *
    2020 * @since 1.7.0
     21 * @since 14.3.0 Changed the `$name` property's description.
    2122 *
    2223 * @todo We should probably do something similar to BP_Component::start().
     
    2627 *     An array of properties describing the theme compat package.
    2728 *     @type string $id      ID of the package. Must be unique.
    28  *     @type string $name    Name of the theme. This should match the name given
     29 *     @type string $name    Raw name for the theme. This should match the name given
    2930 *                           in style.css.
    3031 *     @type string $version Theme version. Used for busting script and style
  • trunk/src/bp-friends/classes/class-bp-friends-component.php

    r14026 r14059  
    2929        parent::start(
    3030            'friends',
    31             _x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ),
     31            'Friend Connections',
    3232            buddypress()->plugin_dir,
    3333            array(
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r14026 r14059  
    118118        parent::start(
    119119            'groups',
    120             _x( 'User Groups', 'Group screen page <title>', 'buddypress' ),
     120            'User Groups',
    121121            buddypress()->plugin_dir,
    122122            array(
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r14026 r14059  
    7676        parent::start(
    7777            'members',
    78             __( 'Members', 'buddypress' ),
     78            'Members',
    7979            buddypress()->plugin_dir,
    8080            array(
  • trunk/src/bp-members/classes/class-bp-members-invitations-component.php

    r13993 r14059  
    3131        parent::start(
    3232            'members_invitations',
    33             __( 'Members Invitations', 'buddypress' ),
     33            'Members Invitations',
    3434            '',
    3535            array()
  • trunk/src/bp-messages/classes/class-bp-messages-component.php

    r14026 r14059  
    3838        parent::start(
    3939            'messages',
    40             __( 'Private Messages', 'buddypress' ),
     40            'Private Messages',
    4141            buddypress()->plugin_dir,
    4242            array(
  • trunk/src/bp-notifications/classes/class-bp-notifications-component.php

    r14026 r14059  
    2929        parent::start(
    3030            'notifications',
    31             _x( 'Notifications', 'Page <title>', 'buddypress' ),
     31            'Notifications',
    3232            buddypress()->plugin_dir,
    3333            array(
  • trunk/src/bp-settings/classes/class-bp-settings-component.php

    r13503 r14059  
    2727        parent::start(
    2828            'settings',
    29             __( 'Settings', 'buddypress' ),
     29            'Settings',
    3030            buddypress()->plugin_dir,
    3131            array(
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r14043 r14059  
    77 * @package BuddyPress
    88 * @subpackage BP_Theme_Compat
    9  * @version 14.0.0
     9 * @version 14.3.0
    1010 */
    1111
     
    5959        $bp            = buddypress();
    6060        $this->id      = 'legacy';
    61         $this->name    = __( 'BuddyPress Legacy', 'buddypress' );
     61        $this->name    = 'BP Legacy';
    6262        $this->version = bp_get_version();
    6363        $this->dir     = trailingslashit( $bp->themes_dir . '/bp-legacy' );
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r14049 r14059  
    4848        parent::start(
    4949            'xprofile',
    50             _x( 'Extended Profiles', 'Component page <title>', 'buddypress' ),
     50            'Extended Profiles',
    5151            buddypress()->plugin_dir,
    5252            array(
  • trunk/src/class-buddypress.php

    r14026 r14059  
    897897            array(
    898898                'id'      => 'legacy',
    899                 'name'    => __( 'BuddyPress Legacy', 'buddypress' ),
     899                'name'    => 'BP Legacy',
    900900                'version' => bp_get_version(),
    901901                'dir'     => trailingslashit( $this->themes_dir . '/bp-legacy' ),
     
    907907            array(
    908908                'id'      => 'nouveau',
    909                 'name'    => __( 'BuddyPress Nouveau', 'buddypress' ),
     909                'name'    => 'BP Nouveau',
    910910                'version' => bp_get_version(),
    911911                'dir'     => trailingslashit( $this->themes_dir . '/bp-nouveau' ),
Note: See TracChangeset for help on using the changeset viewer.