Skip to:
Content

BuddyPress.org

Ticket #5030: 5030.patch

File 5030.patch, 1.3 KB (added by boonebgorges, 11 years ago)
  • bp-core/bp-core-functions.php

    diff --git bp-core/bp-core-functions.php bp-core/bp-core-functions.php
    index affe353..2f10822 100644
    function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { 
    13161316 * @package BuddyPress Core
    13171317 */
    13181318function bp_core_load_buddypress_textdomain() {
    1319         $locale        = apply_filters( 'buddypress_locale', get_locale() );
    1320         $mofile        = sprintf( 'buddypress-%s.mo', $locale );
    1321         $mofile_global = WP_LANG_DIR . '/' . $mofile;
    1322         $mofile_local  = BP_PLUGIN_DIR . 'bp-languages/' . $mofile;
    1323 
    1324         if ( file_exists( $mofile_global ) )
    1325                 return load_textdomain( 'buddypress', $mofile_global );
    1326         elseif ( file_exists( $mofile_local ) )
    1327                 return load_textdomain( 'buddypress', $mofile_local );
    1328         else
    1329                 return false;
     1319        // Try to load via load_plugin_textdomain() first, for future
     1320        // wordpress.org translation downloads
     1321        if ( load_plugin_textdomain( 'buddypress', false, 'buddypress/bp-languages' ) ) {
     1322                return true;
     1323        }
     1324
     1325        // Nothing found in bp-languages, so try to load from WP_LANG_DIR
     1326        $locale = apply_filters( 'buddypress_locale', get_locale() );
     1327        $mofile = WP_LANG_DIR . '/buddypress-' . $locale . '.mo';
     1328
     1329        return load_textdomain( 'buddypress', $mofile );
    13301330}
    13311331add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
    13321332