Uses
Uses | Description |
---|---|
wp-includes/l10n.php: _get_path_to_translation() | Gets the path to a translation file for loading a textdomain just in time. |
wp-includes/l10n.php: load_textdomain() | Load a .mo file into the text domain $domain. |
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use get_translations_for_domain() instead.
Loads plugin and theme textdomains just-in-time.
When a textdomain is encountered for the first time, we try to load the translation file from wp-content/languages
, removing the need to call load_plugin_texdomain() or load_theme_texdomain().
(string) (Required) Text domain. Unique identifier for retrieving translated strings.
(bool) True when the textdomain is successfully loaded, false otherwise.
File: wp-includes/l10n.php
function _load_textdomain_just_in_time( $domain ) { global $l10n_unloaded; $l10n_unloaded = (array) $l10n_unloaded; // Short-circuit if domain is 'default' which is reserved for core. if ( 'default' === $domain || isset( $l10n_unloaded[ $domain ] ) ) { return false; } $translation_path = _get_path_to_translation( $domain ); if ( false === $translation_path ) { return false; } return load_textdomain( $domain, $translation_path ); }
Version | Description |
---|---|
4.6.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_load_textdomain_just_in_time