Make WordPress Core

Changeset 16041


Ignore:
Timestamp:
10/28/2010 08:45:35 AM (15 years ago)
Author:
westi
Message:

Revert [16039]. Wasn't as much junk as it looked :-( See #14772.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar/admin-bar-class.php

    r16039 r16041  
    201201        return false;
    202202    }
     203
     204    function load_user_locale_translations() {
     205        $this->need_to_change_locale = ( get_locale() != $this->user->locale );
     206        if ( ! $this->need_to_change_locale )
     207            return;
     208        $this->previous_translations = get_translations_for_domain( 'default' );
     209        $this->adminbar_locale_filter = lambda( '$_', '$GLOBALS["wp_admin_bar"]->user->locale;' );
     210        unload_textdomain( 'default' );
     211        add_filter( 'locale', $this->adminbar_locale_filter );
     212        load_default_textdomain();
     213        $this->changed_locale = true;
     214    }
     215
     216    function unload_user_locale_translations() {
     217        global $l10n;
     218        if ( ! $this->changed_locale )
     219            return;
     220        remove_filter( 'locale', $this->adminbar_locale_filter );
     221        $l10n['default'] = &$this->previous_translations;
     222    }
    203223}
    204224?>
Note: See TracChangeset for help on using the changeset viewer.