Loads the translated strings for a plugin residing in the mu-plugins directory.
Parameters
$domain
stringrequired- Text domain. Unique identifier for retrieving translated strings.
$mu_plugin_rel_path
stringoptional- Relative to
WPMU_PLUGIN_DIR
directory in which the .mo file resides.Default:
''
Source
/**
* Loads the theme's translated strings.
*
* 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.
*
* @since 1.5.0
* @since 4.6.0 The function now tries to load the .mo file from the languages directory first.
* @since 6.7.0 Translations are no longer immediately loaded, but handed off to the just-in-time loading mechanism.
*
* @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
*
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
* @param string|false $path Optional. Path to the directory containing the .mo file.
* Default false.
* @return bool True when textdomain is successfully loaded, false otherwise.
*/
function load_theme_textdomain( $domain, $path = false ) {
/** @var WP_Textdomain_Registry $wp_textdomain_registry */
global $wp_textdomain_registry;
if ( ! is_string( $domain ) ) {
Example from Codex: