Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r19059 r20788  
    273273 * @param string $singular Single form to be i18ned
    274274 * @param string $plural Plural form to be i18ned
     275 * @param string $domain Optional. The domain identifier the text will be retrieved in
    275276 * @return array array($singular, $plural)
    276277 */
    277 function _n_noop( $singular, $plural ) {
    278         return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null );
     278function _n_noop( $singular, $plural, $domain = null ) {
     279        return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null, 'domain' => $domain );
    279280}
    280281
    … …  
    284285 * @see _n_noop()
    285286 */
    286 function _nx_noop( $singular, $plural, $context ) {
    287         return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context );
     287function _nx_noop( $singular, $plural, $context, $domain = null ) {
     288        return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context, 'domain' => $domain );
    288289}
    289290
    … …  
    294295 * @param array $nooped_plural Array with singular, plural and context keys, usually the result of _n_noop() or _nx_noop()
    295296 * @param int $count Number of objects
    296  * @param string $domain Optional. The domain identifier the text should be retrieved in
     297 * @param string $domain Optional. The domain identifier the text should be retrieved in. If $nooped_plural contains
     298 *      a domain passed to _n_noop() or _nx_noop(), it will override this value.
    297299 */
    298300function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
     301        if ( $nooped_plural['domain'] )
     302                $domain = $nooped_plural['domain'];
     303
    299304        if ( $nooped_plural['context'] )
    300305                return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
    … …  
    383388        load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );
    384389
    385         if ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {
     390        if ( ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) && ! file_exists(  WP_LANG_DIR . "/admin-$locale.mo" ) ) {
    386391                load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );
    387         }
     392                return;
     393        }
     394
     395        if ( is_admin()  )
     396                load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
     397
     398        if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
     399                load_textdomain( 'default', WP_LANG_DIR . "/admin-network-$locale.mo" );
     400
    388401}
    389402
    … …  
    528541        foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
    529542                $lang_file = basename($lang_file, '.mo');
    530                 if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) )
     543                if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) &&
     544                        0 !== strpos( $lang_file, 'admin-' ))
    531545                        $languages[] = $lang_file;
    532546        }
Note: See TracChangeset for help on using the changeset viewer.