diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 5b93f9c..b021a1e 100644
|
|
function bp_is_get_request() { |
1700 | 1700 | * @return bool True on success, false on failure. |
1701 | 1701 | */ |
1702 | 1702 | function 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; |
| 1703 | $domain = 'buddypress'; |
| 1704 | $mofile_custom = sprintf( '%s-%s.mo', $domain, apply_filters( 'buddypress_locale', get_locale() ) ); |
| 1705 | |
| 1706 | $locations = apply_filters( 'buddypress_locale_locations', array( |
| 1707 | trailingslashit( WP_LANG_DIR ), |
| 1708 | trailingslashit( WP_LANG_DIR . '/' . $domain ), |
| 1709 | trailingslashit( WP_LANG_DIR . '/custom' ), |
| 1710 | ) ); |
| 1711 | |
| 1712 | // Try custom locations in WP_LANG_DIR |
| 1713 | foreach ( $locations as $location ) { |
| 1714 | if ( load_textdomain( 'buddypress', $location . $mofile_custom ) ) { |
| 1715 | return true; |
| 1716 | } |
1707 | 1717 | } |
1708 | 1718 | |
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 ); |
| 1719 | // default to WP and glotpress |
| 1720 | return load_plugin_textdomain( $domain ); |
1714 | 1721 | } |
1715 | 1722 | add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' ); |
1716 | 1723 | |
… |
… |
function bp_core_get_suggestions( $args ) { |
2034 | 2041 | } |
2035 | 2042 | |
2036 | 2043 | return apply_filters( 'bp_core_get_suggestions', $retval, $args ); |
2037 | | } |
2038 | | No newline at end of file |
| 2044 | } |