bp_core_load_buddypress_textdomain()
Load the buddyboss translation file for current language.
Description
See also
- load_textdomain(): for a description of return values.
Return
(bool) True on success, false on failure.
Source
File: bp-core/bp-core-functions.php
2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 | function bp_core_load_buddypress_textdomain() { $domain = 'buddyboss' ; /** * Filters the locale to be loaded for the language files. * * @since BuddyPress 1.0.2 * * @param string $value Current locale for the install. */ $mofile_custom = sprintf( '%s-%s.mo' , $domain , apply_filters( 'buddypress_locale' , get_locale() ) ); /** * Filters the locations to load language files from. * * @since BuddyPress 2.2.0 * * @param array $value Array of directories to check for language files in. */ $locations = apply_filters( 'buddypress_locale_locations' , array ( trailingslashit( WP_LANG_DIR . '/' . $domain ), trailingslashit( WP_LANG_DIR ), ) ); // Try custom locations in WP_LANG_DIR. foreach ( $locations as $location ) { if ( load_textdomain( 'buddyboss' , $location . $mofile_custom ) ) { return true; } } // Default to WP and glotpress. return load_plugin_textdomain( $domain ); } |
Changelog
Version | Description |
---|---|
BuddyPress 1.0.2 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.