Function Reference/load textdomain
Description
Loads MO file into the list of domains.
If the domain already exists, the inclusion will fail. If the MO file is not readable, the inclusion will fail.
On success, the mofile will be placed in the $l10n global by $domain and will be an gettext_reader object.
Usage
<?php load_textdomain( $domain, $mofile ) ?>
Parameters
- $domain
- (string) (required) Unique identifier for retrieving translated strings
- Default: None
- $mofile
- (string) (required) Path to the .mo file
- Default: None
Return Values
- (null)
- On failure returns null and also on success returns nothing.
Examples
Notes
- Uses global: (array) $l10n Gets list of domain translated string gettext_reader objects.
- Uses: CacheFileReader() Reads the MO file.
- Uses: gettext_reader obect. Allows for retrieving translated strings.
- l10n is an abbreviation for localization.
Change Log
Since: 1.5.0
Source File
load_textdomain() is located in wp-includes/l10n.php.
Related
Localization: get_locale(), load_default_textdomain(), load_plugin_textdomain(), load_textdomain(), load_theme_textdomain()