Changeset 7204 for trunk/bp-core/bp-core-functions.php
- Timestamp:
- 06/12/2013 09:49:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r7104 r7204 1317 1317 */ 1318 1318 function 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 ); 1330 1330 } 1331 1331 add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' );
Note: See TracChangeset
for help on using the changeset viewer.