Skip to:
Content

BuddyPress.org

Ticket #5887: 5887.load_plugin_textdomain.patch

File 5887.load_plugin_textdomain.patch, 1.0 KB (added by r-a-y, 10 years ago)
  • src/bp-core/bp-core-functions.php

     
    17001700 * @return bool True on success, false on failure.
    17011701 */
    17021702function bp_core_load_buddypress_textdomain() {
    1703         // Try to load via load_plugin_textdomain() first, for future
    1704         // wordpress.org translation downloads
    1705         if ( load_plugin_textdomain( 'buddypress', false, 'buddypress/bp-languages' ) ) {
    1706                 return true;
    1707         }
    1708 
    1709         // Nothing found in bp-languages, so try to load from WP_LANG_DIR
    1710         $locale = apply_filters( 'buddypress_locale', get_locale() );
    1711         $mofile = WP_LANG_DIR . '/buddypress-' . $locale . '.mo';
    1712 
    1713         return load_textdomain( 'buddypress', $mofile );
     1703        // looks for a language file in the following order:
     1704        //  - /wp-content/plugins/buddypress-YOUR_LOCALE.po
     1705        //  - /wp-content/languages/plugins/buddypress-YOUR_LOCALE.po
     1706        load_plugin_textdomain( 'buddypress' );
    17141707}
    17151708add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
    17161709