load_default_textdomain

Advertisement

Summery Summery

Load default translated strings based on locale.

Syntax Syntax

load_default_textdomain( string $locale = null )

Description Description

Loads the .mo file in WP_LANG_DIR constant path from WordPress root. The translated (.mo) file is named based on the locale.

Parameters Parameters

$locale

(Optional) Locale to load. Default is the value of get_locale().

Default value: null

Return Return

(bool) Whether the textdomain was loaded.

Source Source

File: wp-includes/l10n.php

	unset( $l10n_unloaded[ $domain ] );

	$l10n[ $domain ] = &$mo;

	return true;
}

/**
 * Unload translations for a text domain.
 *
 * @since 3.0.0
 *
 * @global MO[] $l10n          An array of all currently loaded text domains.
 * @global MO[] $l10n_unloaded An array of all text domains that have been unloaded again.
 *
 * @param string $domain Text domain. Unique identifier for retrieving translated strings.
 * @return bool Whether textdomain was unloaded.
 */
function unload_textdomain( $domain ) {
	global $l10n, $l10n_unloaded;

	$l10n_unloaded = (array) $l10n_unloaded;

	/**
	 * Filters whether to override the text domain unloading.

Advertisement

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

See also See also

Advertisement

Leave a Reply