From 20c34b481cabe44867741aa343d5eae387e6d477 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 28 Oct 2010 08:45:35 +0000 Subject: [PATCH] Revert [16039]. Wasn't as much junk as it looked :-( See #14772. git-svn-id: https://develop.svn.wordpress.org/trunk@16041 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/admin-bar/admin-bar-class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp-includes/admin-bar/admin-bar-class.php b/wp-includes/admin-bar/admin-bar-class.php index 003108370a..f213d448a2 100644 --- a/wp-includes/admin-bar/admin-bar-class.php +++ b/wp-includes/admin-bar/admin-bar-class.php @@ -200,5 +200,25 @@ class WP_Admin_Bar { return false; } + + function load_user_locale_translations() { + $this->need_to_change_locale = ( get_locale() != $this->user->locale ); + if ( ! $this->need_to_change_locale ) + return; + $this->previous_translations = get_translations_for_domain( 'default' ); + $this->adminbar_locale_filter = lambda( '$_', '$GLOBALS["wp_admin_bar"]->user->locale;' ); + unload_textdomain( 'default' ); + add_filter( 'locale', $this->adminbar_locale_filter ); + load_default_textdomain(); + $this->changed_locale = true; + } + + function unload_user_locale_translations() { + global $l10n; + if ( ! $this->changed_locale ) + return; + remove_filter( 'locale', $this->adminbar_locale_filter ); + $l10n['default'] = &$this->previous_translations; + } } ?>