Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/09/2020 02:47:32 AM (4 years ago)
Author:
johnjamesjacoby
Message:

Group/Member Types: More string changes.

This commit includes the following code changes:

  • Change case of strings to match how WordPress core labels are cased
  • Reorder schema so singular is before plural (see: order of adjectives)
  • Adds missing taxonomy labels for core functionalities that could be activated or used later (hierarchy, popularity, etc...)
  • Simplifies all verbiage, to be more concise without sacrificing accuracy or descriptiveness (removes example URLs, encoded quotes, etc...)
  • Remove "member" references from default strings, and re-add them back in using member-specific variants to match how groups works
  • Related inline documentation

Together, these changes bring both Group and Member types closer in readability and usability to other taxonomies, making them feel a little bit more familiar, while also keeping strings within 2 lines tall on most viewport sizes, and hopefully making them easier to understand for users who are new to these features.

See #7179, #7181.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-functions.php

    r12768 r12776  
    26902690        'bp_get_member_type_tax_labels',
    26912691        array(
    2692             'name'                       => _x( 'Member types', 'Member type taxonomy name', 'buddypress' ),
    2693             'singular_name'              => _x( 'Member type', 'Member type taxonomy singular name', 'buddypress' ),
    2694             'search_items'               => _x( 'Search Member types', 'Member type taxonomy search items label', 'buddypress' ),
    2695             'popular_items'              => _x( 'Most used Member types', 'Member type taxonomy popular items label', 'buddypress' ),
    2696             'all_items'                  => _x( 'All Member types', 'Member type taxonomy all items label', 'buddypress' ),
    2697             'edit_item'                  => _x( 'Edit Member type', 'Member type taxonomy edit item label', 'buddypress' ),
    2698             'view_item'                  => _x( 'View Member type', 'Member type taxonomy view item label', 'buddypress' ),
    2699             'update_item'                => _x( 'Update Member type', 'Member type taxonomy update item label', 'buddypress' ),
    2700             'add_new_item'               => _x( 'Add new Member type', 'Member type taxonomy add new item label', 'buddypress' ),
    2701             'new_item_name'              => _x( 'New Member type name', 'Member type taxonomy new item name label', 'buddypress' ),
    2702             'separate_items_with_commas' => _x( 'Separate Member types with commas', 'Member type taxonomy separate items with commas label', 'buddypress' ),
    2703             'add_or_remove_items'        => _x( 'Add or remove Member types', 'Member type taxonomy add or remove items label', 'buddypress' ),
    2704             'choose_from_most_used'      => _x( 'Choose from the most used Member types', 'Member type taxonomy choose from most used label', 'buddypress' ),
    2705             'not_found'                  => _x( 'No Member types found', 'Member type taxonomy not found label', 'buddypress' ),
    2706             'no_terms'                   => _x( 'No Member types', 'Member type taxonomy no terms label', 'buddypress' ),
    2707             'items_list_navigation'      => _x( 'Member types list navigation', 'Member type taxonomy items list navigation label', 'buddypress' ),
    2708             'items_list'                 => _x( 'Member types list', 'Member type taxonomy items list label', 'buddypress' ),
    2709             'back_to_items'              => _x( 'Back to all Member types', 'Member type taxonomy back to items label', 'buddypress' ),
     2692
     2693            // General labels
     2694            'name'                       => _x( 'Member Types', 'Member type taxonomy name', 'buddypress' ),
     2695            'singular_name'              => _x( 'Member Type', 'Member type taxonomy singular name', 'buddypress' ),
     2696            'search_items'               => _x( 'Search Member Types', 'Member type taxonomy search items label', 'buddypress' ),
     2697            'popular_items'              => _x( 'Popular Member Types', 'Member type taxonomy popular items label', 'buddypress' ),
     2698            'all_items'                  => _x( 'All Member Types', 'Member type taxonomy all items label', 'buddypress' ),
     2699            'parent_item'                => _x( 'Parent Member Type', 'Member type taxonomy parent item label', 'buddypress' ),
     2700            'parent_item_colon'          => _x( 'Parent Member Type:', 'Member type taxonomy parent item label', 'buddypress' ),
     2701            'edit_item'                  => _x( 'Edit Member Type', 'Member type taxonomy edit item label', 'buddypress' ),
     2702            'view_item'                  => _x( 'View Member Type', 'Member type taxonomy view item label', 'buddypress' ),
     2703            'update_item'                => _x( 'Update Member Type', 'Member type taxonomy update item label', 'buddypress' ),
     2704            'add_new_item'               => _x( 'Add New Member Type', 'Member type taxonomy add new item label', 'buddypress' ),
     2705            'new_item_name'              => _x( 'New Member Type Name', 'Member type taxonomy new item name label', 'buddypress' ),
     2706            'separate_items_with_commas' => _x( 'Separate member types with commas', 'Member type taxonomy separate items with commas label', 'buddypress' ),
     2707            'add_or_remove_items'        => _x( 'Add or remove member types', 'Member type taxonomy add or remove items label', 'buddypress' ),
     2708            'choose_from_most_used'      => _x( 'Choose from the most used meber types', 'Member type taxonomy choose from most used label', 'buddypress' ),
     2709            'not_found'                  => _x( 'No member types found.', 'Member type taxonomy not found label', 'buddypress' ),
     2710            'no_terms'                   => _x( 'No member types', 'Member type taxonomy no terms label', 'buddypress' ),
     2711            'items_list_navigation'      => _x( 'Member Types list navigation', 'Member type taxonomy items list navigation label', 'buddypress' ),
     2712            'items_list'                 => _x( 'Member Types list', 'Member type taxonomy items list label', 'buddypress' ),
     2713
     2714            /* translators: Tab heading when selecting from the most used terms. */
     2715            'most_used'                  => _x( 'Most Used', 'Member type taxonomy most used items label', 'buddypress' ),
     2716            'back_to_items'              => _x( '← Back to Member Types', 'Member type taxonomy back to items label', 'buddypress' ),
     2717
    27102718            // Specific to BuddyPress.
    27112719            'bp_type_id_label'           => _x( 'Member Type ID', 'BP Member type ID label', 'buddypress' ),
     
    27352743        array_merge(
    27362744            array(
    2737                 'description' => _x( 'BuddyPress Member types', 'Member type taxonomy description', 'buddypress' ),
     2745                'description' => _x( 'BuddyPress Member Types', 'Member type taxonomy description', 'buddypress' ),
    27382746                'labels'      => array_merge( bp_get_member_type_tax_labels(), bp_get_taxonomy_common_labels() ),
    27392747            ),
     
    27422750    );
    27432751}
     2752
     2753/**
     2754 * Extend generic Type metadata schema to match Member Type needs.
     2755 *
     2756 * @since 7.0.0
     2757 *
     2758 * @param array  $schema   The generic Type metadata schema.
     2759 * @param string $taxonomy The taxonomy name the schema applies to.
     2760 * @return array           The Member Type metadata schema.
     2761 */
     2762function bp_get_member_type_metadata_schema( $schema = array(), $taxonomy = '' ) {
     2763    if ( bp_get_member_type_tax_name() === $taxonomy ) {
     2764
     2765        // Directory
     2766        if ( isset( $schema['bp_type_has_directory']['description'] ) ) {
     2767            $schema['bp_type_has_directory']['description'] = __( 'Make a list of members matching this type available on the members directory.', 'buddypress' );
     2768        }
     2769
     2770        // Slug
     2771        if ( isset( $schema['bp_type_directory_slug']['description'] ) ) {
     2772            $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' );
     2773        }
     2774    }
     2775
     2776    return $schema;
     2777}
     2778add_filter( 'bp_get_type_metadata_schema', 'bp_get_member_type_metadata_schema', 1, 2 );
    27442779
    27452780/**
Note: See TracChangeset for help on using the changeset viewer.