Title: is_textdomain_loaded
Published: April 25, 2014
Last modified: May 20, 2026

---

# is_textdomain_loaded( string $domain ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#wp--skip-link--target)

Determines whether there are translations for the text domain.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#parameters)󠁿

 `$domain`stringrequired

Text domain. Unique identifier for retrieving translated strings.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#return)󠁿

 bool Whether there are translations.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#source)󠁿

    ```php
    function is_textdomain_loaded( $domain ) {
    	global $l10n;
    	return isset( $l10n[ $domain ] ) && ! $l10n[ $domain ] instanceof NOOP_Translations;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/l10n.php#L1507)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/l10n.php#L1507-L1510)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#related)󠁿

| Used by | Description | 
| [_get_plugin_data_markup_translate()](https://developer.wordpress.org/reference/functions/_get_plugin_data_markup_translate/)`wp-admin/includes/plugin.php` |

Sanitizes plugin data, optionally adds markup, optionally translates.

  | 
| [WP_Theme::load_textdomain()](https://developer.wordpress.org/reference/classes/wp_theme/load_textdomain/)`wp-includes/class-wp-theme.php` |

Loads the theme’s textdomain.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/?output_format=md#comment-content-4433)
 2.   [Aurovrata Venet](https://profiles.wordpress.org/aurovrata/)  [  6 years ago  ](https://developer.wordpress.org/reference/functions/is_textdomain_loaded/#comment-4433)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_textdomain_loaded%2F%23comment-4433)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_textdomain_loaded%2F%23comment-4433)
 4. There are situations where one requires a plugin translation locale to be loaded
    which is different from the current user locale.
 5. 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,
 6.     ```php
        if ( is_textdomain_loaded( $plugin ) ) {
        	unload_textdomain( $plugin );
        }
        $mofile = sprintf( '%s-%s.mo', $plugin, $locale );
        //check the installation language path first.
        $domain_path = path_join( WP_LANG_DIR, 'plugins' );
        load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
    
        if ( ! $loaded ) { //else, check the plugin language folder.
        	$domain_path = path_join( WP_PLUGIN_DIR, "{$plugin}/languages" );
        	$loaded = load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
        }
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_textdomain_loaded%2F%3Freplytocom%3D4433%23feedback-editor-4433)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_textdomain_loaded%2F)
before being able to contribute a note or feedback.