Changeset 9247
- Timestamp:
- 12/21/2014 11:23:43 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r9242 r9247 1747 1747 */ 1748 1748 function bp_core_load_buddypress_textdomain() { 1749 // Try to load via load_plugin_textdomain() first, for future 1750 // wordpress.org translation downloads 1751 if ( load_plugin_textdomain( 'buddypress', false, 'buddypress/bp-languages' ) ) { 1752 return true; 1753 } 1754 1755 // Nothing found in bp-languages, so try to load from WP_LANG_DIR 1756 $locale = apply_filters( 'buddypress_locale', get_locale() ); 1757 $mofile = WP_LANG_DIR . '/buddypress-' . $locale . '.mo'; 1758 1759 return load_textdomain( 'buddypress', $mofile ); 1749 $domain = 'buddypress'; 1750 $mofile_custom = sprintf( '%s-%s.mo', $domain, apply_filters( 'buddypress_locale', get_locale() ) ); 1751 1752 $locations = apply_filters( 'buddypress_locale_locations', array( 1753 trailingslashit( WP_LANG_DIR . '/' . $domain ), 1754 trailingslashit( WP_LANG_DIR ), 1755 ) ); 1756 1757 // Try custom locations in WP_LANG_DIR 1758 foreach ( $locations as $location ) { 1759 if ( load_textdomain( 'buddypress', $location . $mofile_custom ) ) { 1760 return true; 1761 } 1762 } 1763 1764 // default to WP and glotpress 1765 return load_plugin_textdomain( $domain ); 1760 1766 } 1761 1767 add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
Note: See TracChangeset
for help on using the changeset viewer.