Skip to:
Content

BuddyPress.org

Changeset 13941


Ignore:
Timestamp:
06/27/2024 02:59:36 AM (23 months ago)
Author:
imath
Message:

Make sure default en_US BuddyPress strings can be override

Restore bp_core_load_buddypress_textdomain() so that it's possible to customize all BuddyPress default strings with a custom buddypress-en_US.mo translation file.

Fixes #9187
Closes https://github.com/buddypress/buddypress/pull/322

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

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

    r13936 r13941  
    26032603
    26042604/**
     2605 * Load the buddypress translation file for current language.
     2606 *
     2607 * @since 1.0.2
     2608 *
     2609 * @return void
     2610 */
     2611function bp_core_load_buddypress_textdomain() {
     2612    $domain = 'buddypress';
     2613
     2614    /*
     2615     * In most cases, WordPress already loaded BuddyPress textdomain
     2616     * thanks to the `_load_textdomain_just_in_time()` function.
     2617     */
     2618    if ( is_textdomain_loaded( $domain ) ) {
     2619        return;
     2620    }
     2621
     2622    /*
     2623     * We only need to keep loading BuddyPress textdomain to allow
     2624     * the usage of custom `en_US` translation files.
     2625     */
     2626    load_plugin_textdomain( $domain );
     2627}
     2628add_action( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
     2629
     2630/**
    26052631 * A JavaScript-free implementation of the search functions in BuddyPress.
    26062632 *
  • trunk/src/bp-core/deprecated/14.0.php

    r13937 r13941  
    8787
    8888/**
    89  * Load the buddypress translation file for current language.
    90  *
    91  * @since 1.0.2
    92  * @deprecated 14.0.0
    93  *
    94  * @return bool
    95  */
    96 function bp_core_load_buddypress_textdomain() {
    97     _deprecated_function( __FUNCTION__, '14.0.0' );
    98 
    99     return false;
    100 }
    101 
    102 /**
    10389 * Handle save/update of screen options for the Activity component admin screen.
    10490 *
Note: See TracChangeset for help on using the changeset viewer.