bp_activity_privacy_load_textdomain

Textdomain loader.

Description

bp_activity_privacy_load_textdomain(); 

Checks WP_LANG_DIR for the .mo file first, then the plugin's language folder. Allows for a custom language file other than those packaged with the plugin.


Usage

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

Defined (1)

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

/loader.php  
  1. function bp_activity_privacy_load_textdomain() { 
  2. $mofile = sprintf( 'buddypress-activity-privacy-%s.mo', get_locale() ); 
  3.  
  4. $mofile_global = trailingslashit( WP_LANG_DIR ) . $mofile; 
  5. $mofile_local = BP_ACTIVITY_PRIVACY_PLUGIN_DIR_PATH . 'languages/' . $mofile; 
  6.  
  7. if ( is_readable( $mofile_global ) ) { 
  8. return load_textdomain( 'bp-activity-privacy', $mofile_global ); 
  9. } elseif ( is_readable( $mofile_local ) ) { 
  10. //return load_plugin_textdomain( 'bp-activity-privacy', false, $mofile_local ); 
  11. return load_textdomain( 'bp-activity-privacy', $mofile_local ); 
  12. else 
  13. return false;