load_textdomain [ WordPress Function ]
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Loads a MO file into the domain $domain.
If the domain already exists, the translations will be merged. If both sets have the same string, the translation from the original value will be taken.
On success, the .mo file will be placed in the $l10n global by $domain and will be a MO object.
Source
<?php
function load_textdomain( $domain, $mofile ) {
global $l10n;
$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile );
if ( true == $plugin_override ) {
return true;
}
do_action( 'load_textdomain', $domain, $mofile );
$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
if ( !is_readable( $mofile ) ) return false;
$mo = new MO();
if ( !$mo->import_from_file( $mofile ) ) return false;
if ( isset( $l10n[$domain] ) )
$mo->merge_with( $l10n[$domain] );
$l10n[$domain] = &$mo;
return true;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/load textdomain « WordPress Codex
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.
codex.wordpress.org - [Plugin: Buddystream] Problem with "load_textdomain" - WordPress
I was trying to translate the BuddyStream plugin with CodeStyling Localization plugin and got this message: Loading Issue: Author is using load_textdomain ...
wordpress.org - load_textdomain Wordpress hook details -- Adam Brown, BYU ...
Detailed information about every action hook and filter used in WordPress. Makes Plugin API easier to use. Lists appearance, file location, and deprecation data ...
adambrown.info - Issue #2: Use load_plugin_textdomain() instead of load_textdomain ...
Nov 17, 2010 ... But first look at the core code and figure out the difference. The Codex is blissfully unhelpful on this point.
github.com