bb_load_theme_textdomain

Loads the theme's translated strings.

Description

bb_load_theme_textdomain( (string) $domain, (constant) $path = false ); 

If the current locale exists as a .mo file in the theme's root directory, it will be included in the translated strings by the $domain.

The .mo files must be named based on the locale exactly.

Parameters (2)

0. $domain (string)
Unique identifier for retrieving translated strings
1. $path — Optional. (constant) => false
The path.

Usage

  1. if ( !function_exists( 'bb_load_theme_textdomain' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php'; 
  3.  
  4. // Unique identifier for retrieving translated strings 
  5. $domain = ''; 
  6.  
  7. // The path. 
  8. $path = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_load_theme_textdomain($domain, $path); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-l10n.php  
  1. function bb_load_theme_textdomain($domain, $path = false) { 
  2. $locale = bb_get_locale(); 
  3.  
  4. $mofile = ( empty( $path ) ) ? bb_get_template( $locale . '.mo' ) : "$path/$locale.mo"; 
  5.  
  6. load_textdomain($domain, $mofile);