bp_core_load_buddypress_textdomain

Load the buddypress translation file for current language.

Description

bp_core_load_buddypress_textdomain(); 

Usage

  1. if ( !function_exists( 'bp_core_load_buddypress_textdomain' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_load_buddypress_textdomain(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-functions.php  
  1. function bp_core_load_buddypress_textdomain() { 
  2. $domain = buddypress; 
  3.  
  4. /** 
  5. * Filters the locale to be loaded for the language files. 
  6. * @since 1.0.2 
  7. * @param string $value Current locale for the install. 
  8. */ 
  9. $mofile_custom = sprintf( '%s-%s.mo', $domain, apply_filters( 'buddypress_locale', get_locale() ) ); 
  10.  
  11. /** 
  12. * Filters the locations to load language files from. 
  13. * @since 2.2.0 
  14. * @param array $value Array of directories to check for language files in. 
  15. */ 
  16. trailingslashit( WP_LANG_DIR . '/' . $domain ),  
  17. trailingslashit( WP_LANG_DIR ),  
  18. ) ); 
  19.  
  20. // Try custom locations in WP_LANG_DIR. 
  21. foreach ( $locations as $location ) { 
  22. if ( load_textdomain( buddypress, $location . $mofile_custom ) ) { 
  23. return true; 
  24.  
  25. // Default to WP and glotpress. 
  26. return load_plugin_textdomain( $domain );