Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




load_textdomain [ WordPress Function ]

load_textdomain ( $domain, $mofile )
Parameters:
  • (string) $domain Unique identifier for retrieving translated strings
  • (string) $mofile Path to the .mo file
Uses:
  • $l10n
Returns:
  • (bool) True on success, false on failure
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ý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics