Skip to:
Content

BuddyPress.org

Ticket #4857: 4857.05.patch

File 4857.05.patch, 1.5 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 eb7917b..ecb2978 100644
    function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { 
    12671267 * @package BuddyPress Core
    12681268 */
    12691269function bp_core_load_buddypress_textdomain() {
    1270         $locale        = apply_filters( 'buddypress_locale', get_locale() );
    1271         $mofile        = sprintf( 'buddypress-%s.mo', $locale );
    1272         $mofile_global = WP_LANG_DIR . '/' . $mofile;
    1273         $mofile_local  = BP_PLUGIN_DIR . 'bp-languages/' . $mofile;
    1274 
    1275         if ( file_exists( $mofile_global ) )
    1276                 return load_textdomain( 'buddypress', $mofile_global );
    1277         elseif ( file_exists( $mofile_local ) )
    1278                 return load_textdomain( 'buddypress', $mofile_local );
    1279         else
    1280                 return false;
     1270        $locale = apply_filters( 'buddypress_locale', get_locale() );
     1271
     1272        // BuddyPress language packs are stored in wp-content/languages
     1273        $plugin_rel_path = '../languages';
     1274
     1275        // Legacy support for .mo files stored in bp-languages
     1276        $legacy_mofile = BP_PLUGIN_DIR . 'bp-languages/' . sprintf( 'buddypress-%s.mo', $locale );
     1277        if ( file_exists( $legacy_mofile ) ) {
     1278                $plugin_rel_path = 'buddypress/bp-languages';
     1279        }
     1280
     1281        return load_plugin_textdomain( 'buddypress', false, $plugin_rel_path );
    12811282}
    1282 add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
     1283add_action( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
    12831284
    12841285/**
    12851286 * A javascript free implementation of the search functions in BuddyPress