Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/l10n.php

    r11681 r11411  
    302302
    303303/**
    304  * Loads a MO file into the domain $domain.
    305  *
    306  * If the domain already exists, the translations will be merged. If both
    307  * sets have the same string, the translation from the original value will be taken.
     304 * Loads MO file into the list of domains.
     305 *
     306 * If the domain already exists, the inclusion will fail. If the MO file is not
     307 * readable, the inclusion will fail.
    308308 *
    309309 * On success, the .mo file will be placed in the $l10n global by $domain
    310  * and will be a MO object.
     310 * and will be an gettext_reader object.
    311311 *
    312312 * @since 1.5.0
    313  * @uses $l10n Gets list of domain translated string objects
     313 * @uses $l10n Gets list of domain translated string (gettext_reader) objects
     314 * @uses CacheFileReader Reads the MO file
     315 * @uses gettext_reader Allows for retrieving translated strings
    314316 *
    315317 * @param string $domain Unique identifier for retrieving translated strings
    316318 * @param string $mofile Path to the .mo file
    317  * @return bool true on success, false on failure
     319 * @return null On failure returns null and also on success returns nothing.
    318320 */
    319321function load_textdomain($domain, $mofile) {
    320322    global $l10n;
    321323
    322     if ( !is_readable( $mofile ) ) return false;
     324    if ( !is_readable($mofile)) return;
    323325
    324326    $mo = new MO();
    325     if ( !$mo->import_from_file( $mofile ) ) return false;
    326 
    327     if ( isset( $l10n[$domain] ) )
     327    $mo->import_from_file( $mofile );
     328
     329    if (isset($l10n[$domain]))
    328330        $mo->merge_with( $l10n[$domain] );
    329331
    330332    $l10n[$domain] = &$mo;
    331     return true;
    332333}
    333334
     
    345346    $mofile = WP_LANG_DIR . "/$locale.mo";
    346347
    347     return load_textdomain('default', $mofile);
     348    load_textdomain('default', $mofile);
    348349}
    349350
     
    372373
    373374    $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
    374     return load_textdomain($domain, $mofile);
     375    load_textdomain($domain, $mofile);
    375376}
    376377
     
    393394
    394395    $mofile = "$path/$locale.mo";
    395     return load_textdomain($domain, $mofile);
     396    load_textdomain($domain, $mofile);
    396397}
    397398
     
    423424 */
    424425function translate_user_role( $name ) {
    425     return translate_with_gettext_context( before_last_bar($name), 'User role' );
     426    return before_last_bar( translate_with_gettext_context( $name, 'User role' ) );
    426427}
    427428?>
Note: See TracChangeset for help on using the changeset viewer.