Determines whether there are translations for the text domain.
Parameters
$domain
stringrequired- Text domain. Unique identifier for retrieving translated strings.
Source
function is_textdomain_loaded( $domain ) {
global $l10n;
return isset( $l10n[ $domain ] ) && ! $l10n[ $domain ] instanceof NOOP_Translations;
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
There are situations where one requires a plugin translation locale to be loaded which is different from the current user locale.
For example, in multilingual websites, creating a translation of a post/widget requires some translations to be loaded for a given plugin text domain. The user locale (dashboard locale) is loaded by default, so it is important to unload that if it has been loaded already and seek the translation file to load for the text domain for the requested locale,