diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 41db806..868eb43 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2226,6 +2226,7 @@ function _drupal_error_handler($error_level, $message, $filename, $line, $contex
  *   The exception object that was thrown.
  */
 function _drupal_exception_handler($exception) {
+
   require_once DRUPAL_ROOT . '/core/includes/errors.inc';
 
   try {
@@ -2463,12 +2464,14 @@ function drupal_container(Container $new_container = NULL, $rebuild = FALSE) {
       ->addArgument(new Reference('cache.config'));
 
     // Register configuration object factory.
-    $container->register('config.subscriber.globalconf', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber');
+    $container->register('config.subscriber.globalconf', 'Drupal\Core\EventSubscriber\ConfigOverrideSubscriber');
     $container->register('dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher')
       ->addMethodCall('addSubscriber', array(new Reference('config.subscriber.globalconf')));
-    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+    $container->register('config.context', 'Drupal\Core\Config\Context\GlobalContext')
       ->addArgument(new Reference('config.storage'))
       ->addArgument(new Reference('dispatcher'));
+    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+      ->addArgument(new Reference('config.context'));
 
     // Register staging configuration storage.
     $container
diff --git a/core/includes/config.inc b/core/includes/config.inc
index 00c7fa6..bacaf72 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -1,6 +1,7 @@
 <?php
 
 use Drupal\Core\Config\Config;
+use Drupal\Core\Config\Context\AdminContext;
 use Drupal\Core\Config\FileStorage;
 use Drupal\Core\Config\NullStorage;
 use Drupal\Core\Config\StorageInterface;
@@ -93,16 +94,28 @@ function config_get_storage_names_with_prefix($prefix = '') {
  * @code config('book.admin') @endcode will return a configuration object in
  * which the book module can store its administrative settings.
  *
- * @param $name
+ * A configuration context is an object containing parameters that will be
+ * available to the configuration plug-ins for them to customize the
+ * configuration data in different ways. Examples of parameters used by Drupal
+ * core are:
+ * - 'user.account', to get configuration that may be localized for a user.
+ * - 'config.admin', TRUE to get configuration data without further
+ *   customizations for administration purposes.
+ *
+ * @param string $name
  *   The name of the configuration object to retrieve. The name corresponds to
  *   a configuration file. For @code config('book.admin') @endcode, the config
  *   object returned will contain the contents of book.admin configuration file.
  *
+ * @param Drupal\Core\Config\ContextInterface $context
+ *   (optional) Configuration context to use for the configuration object.
+ *   Defaults to the context object registered in the Drupal Container.
+ *
  * @return Drupal\Core\Config\Config
  *   A configuration object.
  */
-function config($name) {
-  return drupal_container()->get('config.factory')->get($name)->load();
+function config($name, $context = NULL) {
+  return drupal_container()->get('config.factory')->get($name, $context)->load();
 }
 
 /**
@@ -179,14 +192,16 @@ function config_sync_get_changes(StorageInterface $source_storage, StorageInterf
  *   The storage to synchronize configuration to.
  */
 function config_sync_changes(array $config_changes, StorageInterface $source_storage, StorageInterface $target_storage) {
+  $target_context = new AdminContext('config.target', $target_storage);
   foreach (array('delete', 'create', 'change') as $op) {
     foreach ($config_changes[$op] as $name) {
+      $config = new Config($name, $target_context);
       if ($op == 'delete') {
-        $target_storage->delete($name);
+        $config->delete();
       }
       else {
         $data = $source_storage->read($name);
-        $target_storage->write($name, $data);
+        $config->setData($data)->save();
       }
     }
   }
@@ -245,6 +260,7 @@ function config_import() {
  * @todo Add support for other extension types; e.g., themes etc.
  */
 function config_import_invoke_owner(array $config_changes, StorageInterface $source_storage, StorageInterface $target_storage) {
+  $target_context = new AdminContext('config.target', $target_storage);
   // Allow modules to take over configuration change operations for
   // higher-level configuration data.
   // First pass deleted, then new, and lastly changed configuration, in order to
@@ -257,11 +273,11 @@ function config_import_invoke_owner(array $config_changes, StorageInterface $sou
       // handle the configuration change.
       $handled_by_module = FALSE;
       if (module_exists($module) && module_hook($module, 'config_import_' . $op)) {
-        $old_config = new Config($name, $target_storage);
+        $old_config = new Config($name, $target_context);
         $old_config->load();
 
         $data = $source_storage->read($name);
-        $new_config = new Config($name, $target_storage);
+        $new_config = new Config($name, $target_context);
         if ($data !== FALSE) {
           $new_config->setData($data);
         }
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 5366436..a1fb580 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -319,9 +319,11 @@ function install_begin_request(&$install_state) {
     $container->register('dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher');
 
     $container->register('config.storage', 'Drupal\Core\Config\InstallStorage');
-    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+    $container->register('config.context', 'Drupal\Core\Config\Context\ConfigContext')
       ->addArgument(new Reference('config.storage'))
       ->addArgument(new Reference('dispatcher'));
+    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+      ->addArgument(new Reference('config.context'));
     drupal_container($container);
   }
 
diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php
index 6fc2a87..7021b22 100644
--- a/core/lib/Drupal/Core/Config/Config.php
+++ b/core/lib/Drupal/Core/Config/Config.php
@@ -8,7 +8,6 @@
 namespace Drupal\Core\Config;
 
 use Drupal\Component\Utility\NestedArray;
-use Symfony\Component\EventDispatcher\EventDispatcher;
 
 /**
  * Defines the default configuration object.
@@ -51,34 +50,32 @@ class Config {
   protected $overriddenData;
 
   /**
-   * The storage used to load and save this configuration object.
+   * The configuration context used for this configuration object.
    *
-   * @var Drupal\Core\Config\StorageInterface
+   * @var Drupal\Core\Config\ContextInterface
    */
-  protected $storage;
+  protected $context;
 
   /**
-   * The event dispatcher used to notify subscribers.
+   * The storage used to load and save this configuration object.
    *
-   * @var Symfony\Component\EventDispatcher\EventDispatcher
+   * @var Drupal\Core\Config\StorageInterface
    */
-  protected $eventDispatcher;
+  protected $storage;
 
   /**
    * Constructs a configuration object.
    *
    * @param string $name
    *   The name of the configuration object being constructed.
-   * @param Drupal\Core\Config\StorageInterface $storage
+   * @param Drupal\Core\Config\ContextInterface $context
    *   A storage controller object to use for reading and writing the
    *   configuration data.
-   * @param Symfony\Component\EventDispatcher\EventDispatcher $event_dispatcher
-   *   The event dispatcher used to notify subscribers.
    */
-  public function __construct($name, StorageInterface $storage, EventDispatcher $event_dispatcher = NULL) {
+  public function __construct($name, ContextInterface $context) {
     $this->name = $name;
-    $this->storage = $storage;
-    $this->eventDispatcher = $event_dispatcher ? $event_dispatcher : drupal_container()->get('dispatcher');
+    $this->context = $context;
+    $this->storage = $context->getStorage();
   }
 
   /**
@@ -385,21 +382,15 @@ public function delete() {
     return $this;
   }
 
-  /**
-   * Retrieve the storage used to load and save this configuration object.
-   *
-   * @return \Drupal\Core\Config\StorageInterface
-   *   The configuration storage object.
-   */
-  public function getStorage() {
-    return $this->storage;
-  }
 
   /**
-   * Dispatch a config event.
+   * Dispatches a config event.
+   *
+   * @param $config_event_name
+   *   Event name.
    */
   protected function notify($config_event_name) {
-    $this->eventDispatcher->dispatch('config.' . $config_event_name, new ConfigEvent($this));
+    $this->context->notify($config_event_name, $this);
   }
 
   /*
diff --git a/core/lib/Drupal/Core/Config/ConfigEvent.php b/core/lib/Drupal/Core/Config/ConfigEvent.php
index aabd1d8..efe6953 100644
--- a/core/lib/Drupal/Core/Config/ConfigEvent.php
+++ b/core/lib/Drupal/Core/Config/ConfigEvent.php
@@ -3,9 +3,9 @@
 namespace Drupal\Core\Config;
 
 use Symfony\Component\EventDispatcher\Event;
-use Drupal\Core\Config\Config;
 
 class ConfigEvent extends Event {
+
   /**
    * Configuration object.
    *
@@ -14,10 +14,23 @@ class ConfigEvent extends Event {
   protected $config;
 
   /**
-   * Constructor.
+   * Configuration context object.
+   *
+   * @var Drupal\Core\Config\ContextInterface
+   */
+  protected $context;
+
+  /**
+   * Constructs a configuration event object.
+   *
+   * @param Drupal\Core\Config\ContextInterface
+   *   Configuration context object.
+   * @param Drupal\Core\Config\Config
+   *   (optional) Configuration object.
    */
-  public function __construct(Config $config) {
+  public function __construct(ContextInterface $context, Config $config = NULL) {
     $this->config = $config;
+    $this->context = $context;
   }
 
   /**
@@ -26,4 +39,14 @@ public function __construct(Config $config) {
   public function getConfig() {
     return $this->config;
   }
+
+  /**
+   * Get configuration context object.
+   *
+   * @return Drupal\Core\Config\ContextInterface
+   *   Configuration context.
+   */
+  public function getContext() {
+    return $this->context;
+  }
 }
diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php
index ca36ce7..dec7b4e 100644
--- a/core/lib/Drupal/Core/Config/ConfigFactory.php
+++ b/core/lib/Drupal/Core/Config/ConfigFactory.php
@@ -25,44 +25,29 @@
 class ConfigFactory {
 
   /**
-   * A storage controller instance for reading and writing configuration data.
+   * The default configuration context associated with this factory.
    *
-   * @var Drupal\Core\Config\StorageInterface
+   * @var Drupal\Core\Config\ContextInterface
    */
-  protected $storage;
+  protected  $context;
 
-  /**
-   * An event dispatcher instance to use for configuration events.
-   *
-   * @var Symfony\Component\EventDispatcher\EventDispatcher
-   */
-  protected $eventDispatcher;
-
-  /**
-   * Constructs the Config factory.
-   *
-   * @param Drupal\Core\Config\StorageInterface $storage
-   *   The storage controller object to use for reading and writing
-   *   configuration data.
-   * @param Symfony\Component\EventDispatcher\EventDispatcher
-   *   An event dispatcher instance to use for configuration events.
-   */
-  public function __construct(StorageInterface $storage, EventDispatcher $event_dispatcher) {
-    $this->storage = $storage;
-    $this->eventDispatcher = $event_dispatcher;
+  public function __construct(ContextInterface $context) {
+    $this->setContext($context);
   }
 
   /**
-   * Returns a configuration object for a given name.
+   * Returns a configuration object for a given name and context.
    *
    * @param string $name
    *   The name of the configuration object to construct.
    *
+   * @param Drupal\Core\Config\ContextInterface $context
+   *   (optional) Context to use to get the configuration
+   *
    * @return Drupal\Core\Config\Config
    *   A configuration object with the given $name.
    */
-  public function get($name) {
-    global $conf;
+  public function get($name, $context = NULL) {
 
     // @todo Caching the instantiated objects per name might cut off a fair
     //   amount of CPU time and memory. Only the data within the configuration
@@ -82,8 +67,28 @@ public function get($name) {
     // @todo The decrease of CPU time is interesting, since that means that
     //   ContainerBuilder involves plenty of function calls (which are known to
     //   be slow in PHP).
-    $config = new Config($name, $this->storage, $this->eventDispatcher);
+    $config = new Config($name, $context ?: $this->context);
     return $config->init();
   }
 
+  /**
+   * Gets the default context for this factory.
+   *
+   * @return Drupal\Core\Config\ContextInterface
+   *   A configuration context instance.
+   */
+  public function getContext() {
+    return $this->context;
+  }
+
+  /**
+   * Sets the default context for this factory.
+   *
+   * @param Drupal\Core\Config\ContextInterface $context
+   *   Context to use to get the configuration.
+   */
+  public function setContext($context) {
+    $this->context = $context;
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Config/Context/AdminContext.php b/core/lib/Drupal/Core/Config/Context/AdminContext.php
new file mode 100644
index 0000000..8c284a9
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/AdminContext.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Config\AdminContext.
+ */
+
+namespace Drupal\Core\Config\Context;
+
+use Drupal\Core\KeyValueStore\MemoryStorage;
+use Drupal\Core\Config\StorageInterface;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+/**
+ * Defines a configuration context for administration operations.
+ *
+ * This context won't get overrides from global $conf and will have a unique
+ * name depending on the operation to perform. It can be used for importing
+ * or exporting configuration or for administrative operations.
+ */
+class AdminContext extends ConfigContext {
+
+  /**
+   * Overrides Drupal\Core\Config\ConfigContext::__construct().
+   *
+   * @param string $name
+   *   Context name that may have any string value. Some names used in Drupal
+   *   core are 'config.source', 'config.target', 'system.config'.
+   * @param Drupal\Core\Config\StorageInterface $storage
+   *   (optional) The storage controller object to use for reading and writing
+   *   configuration data. Defaults to the storage controller object registered
+   *   in the Drupal Container.
+   */
+  public function __construct($name, StorageInterface $storage = NULL) {
+    $this->set(self::ADMIN, $name);
+    $this->set($name, TRUE);
+    parent::__construct($storage ?: drupal_container()->get('config.storage'), drupal_container()->get('dispatcher'));
+    // Notify event listeners that a configuration context has been created.
+    $this->notify('context', NULL);
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Config/Context/ConfigContext.php b/core/lib/Drupal/Core/Config/Context/ConfigContext.php
new file mode 100644
index 0000000..f025313
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/ConfigContext.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Config\Context\ConfigContext.
+ */
+
+namespace Drupal\Core\Config\Context;
+
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigEvent;
+use Drupal\Core\Config\ContextInterface;
+use Drupal\Core\Config\StorageInterface;
+use Drupal\Core\KeyValueStore\MemoryStorage;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+/**
+ * Defines the configuration context object.
+ *
+ * The configuration object factory instantiates a Config object for each
+ * configuration object name that is accessed and returns it to callers.
+ *
+ * @see Drupal\Core\Config\Config
+ *
+ * Each configuration object gets a storage controller object injected, which
+ * is used for reading and writing the configuration data.
+ *
+ * @see Drupal\Core\Config\StorageInterface
+ */
+class ConfigContext extends MemoryStorage implements ContextInterface {
+
+  /**
+   * Predefined key, will be TRUE for administrative contexts.
+   */
+  const ADMIN = 'config.admin';
+
+  /**
+   * Predefined key, will contain the object type for object contexts.
+   */
+  const OBJECT = 'config.object';
+
+  /**
+   * Predefined key, values to override specific configuration objects.
+   */
+  const OVERRIDE = 'config.override';
+
+  /**
+   * A storage controller instance for reading and writing configuration data.
+   *
+   * @var Drupal\Core\Config\StorageInterface
+   */
+  protected $storage;
+
+  /**
+   * An event dispatcher instance to use for configuration events.
+   *
+   * @var Symfony\Component\EventDispatcher\EventDispatcher
+   */
+  protected $eventDispatcher;
+
+  /**
+   * Constructs the configuration context.
+   *
+   * @param Drupal\Core\Config\StorageInterface $storage
+   *   The storage controller object to use for reading and writing
+   *   configuration data.
+   * @param Symfony\Component\EventDispatcher\EventDispatcher $event_dispatcher
+   *   An event dispatcher instance to use for configuration events.
+   */
+  public function __construct(StorageInterface $storage, EventDispatcher $event_dispatcher) {
+    $this->storage = $storage;
+    $this->eventDispatcher = $event_dispatcher;
+  }
+
+  /**
+   * Implements Drupal\Core\Config\ContextInterface::getStorage().
+   */
+  public function getStorage() {
+    return $this->storage;
+  }
+
+  /**
+   * Implements Drupal\Core\Config\ContextInterface::notify().
+   */
+  public function notify($config_event_name, Config $config = NULL) {
+    $this->eventDispatcher->dispatch('config.' . $config_event_name, new ConfigEvent($this, $config));
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Config/Context/GlobalContext.php b/core/lib/Drupal/Core/Config/Context/GlobalContext.php
new file mode 100644
index 0000000..d7b1915
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/GlobalContext.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Config\GlobalContext.
+ */
+
+namespace Drupal\Core\Config\Context;
+
+use Drupal\Core\Config\StorageInterface;
+use Drupal\Core\KeyValueStore\MemoryStorage;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+/**
+ * Defines the global configuration context object.
+ *
+ * This is the regular runtime configuration context that uses configuration
+ * overrides from global $conf variable.
+ */
+class GlobalContext extends ConfigContext {
+
+  /**
+   * Overrides Drupal\Core\Config\ConfigContext::__construct().
+   */
+  public function __construct(StorageInterface $storage, EventDispatcher $event_dispatcher) {
+    global $conf;
+    // Set config overrides by reference so they can be added later.
+    $this->data[self::OVERRIDE] = &$conf;
+    parent::__construct($storage, $event_dispatcher);
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Config/Context/ObjectContext.php b/core/lib/Drupal/Core/Config/Context/ObjectContext.php
new file mode 100644
index 0000000..d3c7399
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/Context/ObjectContext.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Config\Context\ObjectContext.
+ */
+
+namespace Drupal\Core\Config\Context;
+
+/**
+ * Defines a configuration context for some Drupal object.
+ *
+ * This is a configuration context built around a specific object. They will
+ * have the object type under the ConfigContext::TYPE_OBJECT key and the object
+ * value under the object type key.
+ *
+ * For instance for an object with name 'mymodule.myobject' and value $object
+ * these are the preset keys and values:
+ * - ConfigContext::TYPE_OBJECT, will contain 'mymodule.myobject'
+ * - 'mymodule.myobject', will contain the object itself,
+ *
+ * @see Drupal\user\UserConfigContext
+ */
+class ObjectContext extends GlobalContext {
+
+  /**
+   * Overrides Drupal\Core\Config\ConfigContext::__construct().
+   *
+   * @param string $name
+   *   Object name containing a module name and an object type glued by a dot.
+   * @param mixed $object
+   *   The object value.
+   */
+  public function __construct($name, $object) {
+    // Set the object name for reference.
+    $this->set(self::OBJECT, $name);
+    $this->set($name, $object);
+    parent::__construct(drupal_container()->get('config.storage'), drupal_container()->get('dispatcher'));
+    // Notify event listeners that a configuration context has been created.
+    $this->notify('context', NULL);
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Config/ContextInterface.php b/core/lib/Drupal/Core/Config/ContextInterface.php
new file mode 100644
index 0000000..44b725b
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ContextInterface.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Config\ContextInterface.
+ */
+
+namespace Drupal\Core\Config;
+
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
+
+/**
+ * Defines the configuration context interface.
+ *
+ * The configuration context object will contain predefined parameters used
+ * by the configuration object for storage operations and notifications
+ * and contextual data to be used by configuration event listeners.
+ *
+ * @see Drupal\Core\Config\Config
+ * @see Drupal\Core\Config\ConfigFactory
+ * @see config()
+ */
+interface ContextInterface extends KeyValueStoreInterface {
+
+  /**
+   * Get storage controller.
+   *
+   * @return Drupal\Core\Config\StorageInterface
+   *   A storage controller instance for reading and writing configuration data.
+   */
+  public function getStorage();
+
+  /**
+   * Dispatches a config event.
+   *
+   * @param string $config_event_name
+   *   Event name.
+   * @param Drupal\Core\Config\Config $config
+   *   (optional) Configuration object.
+   */
+  public function notify($config_event_name, Config $config = NULL);
+
+}
diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php
index c6381c8..7ab31d7 100644
--- a/core/lib/Drupal/Core/CoreBundle.php
+++ b/core/lib/Drupal/Core/CoreBundle.php
@@ -50,12 +50,14 @@ public function build(ContainerBuilder $container) {
       ->addArgument(new Reference('cache.config'));
 
     // Register configuration object factory.
-    $container->register('config.subscriber.globalconf', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber');
+    $container->register('config.subscriber.globalconf', 'Drupal\Core\EventSubscriber\ConfigOverrideSubscriber');
     $container->register('dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher')
       ->addMethodCall('addSubscriber', array(new Reference('config.subscriber.globalconf')));
-    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+    $container->register('config.context', 'Drupal\Core\Config\Context\GlobalContext')
       ->addArgument(new Reference('config.storage'))
       ->addArgument(new Reference('dispatcher'));
+    $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
+      ->addArgument(new Reference('config.context'));
 
     // Register staging configuration storage.
     $container
@@ -207,7 +209,7 @@ public function build(ContainerBuilder $container) {
       ->addTag('event_subscriber');
     $container->register('request_close_subscriber', 'Drupal\Core\EventSubscriber\RequestCloseSubscriber')
       ->addTag('event_subscriber');
-    $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber')
+    $container->register('config_global_override_subscriber', 'Drupal\Core\EventSubscriber\ConfigOverrideSubscriber')
       ->addTag('event_subscriber');
     $container->register('exception_listener', 'Drupal\Core\EventSubscriber\ExceptionListener')
       ->addTag('event_subscriber')
diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php
deleted file mode 100644
index 6ee6a3d..0000000
--- a/core/lib/Drupal/Core/EventSubscriber/ConfigGlobalOverrideSubscriber.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * @file
- * Definition of Drupal\Core\EventSubscriber\ConfigGlobalOverrideSubscriber.
- */
-
-namespace Drupal\Core\EventSubscriber;
-
-use Drupal\Core\Config\Config;
-use Drupal\Core\Config\ConfigEvent;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
-/**
- * Override configuration values with values in global $conf variable.
- */
-class ConfigGlobalOverrideSubscriber implements EventSubscriberInterface {
-  /**
-   * Override configuration values with global $conf.
-   *
-   * @param Drupal\Core\Config\ConfigEvent $event
-   *   The Event to process.
-   */
-  public function configInit(ConfigEvent $event) {
-    global $conf;
-
-    $config = $event->getConfig();
-    if (isset($conf[$config->getName()])) {
-      $config->setOverride($conf[$config->getName()]);
-    }
-  }
-
-  /**
-   * Implements EventSubscriberInterface::getSubscribedEvents().
-   */
-  static function getSubscribedEvents() {
-    $events['config.init'][] = array('configInit', 30);
-    return $events;
-  }
-}
diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php
new file mode 100644
index 0000000..41ca797
--- /dev/null
+++ b/core/lib/Drupal/Core/EventSubscriber/ConfigOverrideSubscriber.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @file
+ * Definition of Drupal\Core\EventSubscriber\ConfigOverrideSubscriber.
+ */
+
+namespace Drupal\Core\EventSubscriber;
+
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigEvent;
+use Drupal\Core\Config\ContextInterface;
+use Drupal\Core\Config\Context\ConfigContext;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Override configuration values with predefined values in context.
+ */
+class ConfigOverrideSubscriber implements EventSubscriberInterface {
+
+  /**
+   * Overrides configuration values.
+   *
+   * @param Drupal\Core\Config\ConfigEvent $event
+   *   The Event to process.
+   */
+  public function configInit(ConfigEvent $event) {
+    if ($override = $event->getContext()->get(ConfigContext::OVERRIDE)) {
+      $config = $event->getConfig();
+      if (isset($override[$config->getName()])) {
+        $config->setOverride($override[$config->getName()]);
+      }
+    }
+  }
+
+  /**
+   * Implements EventSubscriberInterface::getSubscribedEvents().
+   */
+  public static function getSubscribedEvents() {
+    $events['config.init'][] = array('configInit', 30);
+    return $events;
+  }
+}
diff --git a/core/modules/config/config.api.php b/core/modules/config/config.api.php
index d845667..28cb90f 100644
--- a/core/modules/config/config.api.php
+++ b/core/modules/config/config.api.php
@@ -124,3 +124,25 @@ function hook_config_import_delete($name, $new_config, $old_config) {
   return TRUE;
 }
 
+/**
+ * Deletes configuration upon synchronizing configuration changes.
+ *
+ * This callback is invoked when a new configuration factory is created and
+ * allows a module to take over the synchronization of configuration data.
+ *
+ * Modules should implement this callback if they manage configuration data
+ * (such as image styles, node types, or fields) which needs to be prepared and
+ * passed through module API functions to properly handle a configuration
+ * change.
+ *
+ * @param Drupal\Core\Config\ConfigFactory $factory
+ *   A configuration object containing the new configuration data.
+ */
+function hook_config_factory($factory) {
+  if (!$factory->getContext('locale.language')) {
+    // Add user's language when in user's context.
+    if ($account = $factory->getContext('user.account')) {
+      $factory->setContext('locale.language', user_preferred_language($account));
+    }
+  }
+}
diff --git a/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php b/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
index 3d2fd4a..44df486 100644
--- a/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
+++ b/core/modules/locale/lib/Drupal/locale/LocaleConfigSubscriber.php
@@ -18,6 +18,23 @@
  * $config is always a DrupalConfig object.
  */
 class LocaleConfigSubscriber implements EventSubscriberInterface {
+
+  /**
+   * Initialize configuration context with language.
+   *
+   * @param Drupal\Core\Config\ConfigEvent $event
+   *   The Event to process.
+   */
+  public function configContext(ConfigEvent $event) {
+    $context = $event->getContext();
+    if (!$context->get('locale.language')) {
+      // Add user's language for user context.
+      if ($account = $context->get('user.account')) {
+        $context->set('locale.language', language_load(user_preferred_langcode($account)));
+      }
+    }
+  }
+
   /**
    * Override configuration values with localized data.
    *
@@ -25,11 +42,13 @@ class LocaleConfigSubscriber implements EventSubscriberInterface {
    *   The Event to process.
    */
   public function configLoad(ConfigEvent $event) {
-    $config = $event->getConfig();
-    $language = language(LANGUAGE_TYPE_INTERFACE);
-    $locale_name = $this->getLocaleConfigName($config->getName(), $language);
-    if ($override = $config->getStorage()->read($locale_name)) {
-      $config->setOverride($override);
+    $context = $event->getContext();
+    if ($language = $context->get('locale.language')) {
+      $config = $event->getConfig();
+      $locale_name = $this->getLocaleConfigName($config->getName(), $language);
+      if ($override = $context->getStorage()->read($locale_name)) {
+        $config->setOverride($override);
+      }
     }
   }
 
@@ -47,6 +66,7 @@ public function getLocaleConfigName($name, $language) {
    * Implements EventSubscriberInterface::getSubscribedEvents().
    */
   static function getSubscribedEvents() {
+    $events['config.context'][] = array('configContext', 20);
     $events['config.load'][] = array('configLoad', 20);
     return $events;
   }
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 59c13ec..1586224 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -10,6 +10,7 @@
  * object files are supported.
  */
 
+use Drupal\Core\Config\ConfigFactory;
 use Drupal\locale\LocaleLookup;
 use Drupal\locale\LocaleConfigSubscriber;
 use Drupal\locale\SourceString;
@@ -1058,6 +1059,8 @@ function _locale_rebuild_js($langcode = NULL) {
  * Implements hook_language_init().
  */
 function locale_language_init() {
+  // Add current language to default configuration context.
+  drupal_container()->get('config.context')->set('locale.language', language(LANGUAGE_TYPE_INTERFACE));
   // Add locale helper to configuration subscribers.
   drupal_container()->get('dispatcher')->addSubscriber(new LocaleConfigSubscriber());
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 46b4b9d..f5c54df 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1378,7 +1378,7 @@ function system_modules_uninstall_submit($form, &$form_state) {
  * @see system_settings_form()
  */
 function system_site_information_settings($form, &$form_state) {
-  $site_config = config('system.site');
+  $site_config = system_config('system.site');
   $site_mail = $site_config->get('mail');
   if (empty($site_mail)) {
     $site_mail = ini_get('sendmail_from');
@@ -1484,7 +1484,7 @@ function system_site_information_settings_validate($form, &$form_state) {
  * Form submission handler for system_site_information_settings().
  */
 function system_site_information_settings_submit($form, &$form_state) {
-  config('system.site')
+  system_config('system.site')
     ->set('name', $form_state['values']['site_name'])
     ->set('mail', $form_state['values']['site_mail'])
     ->set('slogan', $form_state['values']['site_slogan'])
@@ -1524,7 +1524,7 @@ function system_cron_settings($form, &$form_state) {
   $form['cron']['cron_safe_threshold'] = array(
     '#type' => 'select',
     '#title' => t('Run cron every'),
-    '#default_value' => config('system.cron')->get('threshold.autorun'),
+    '#default_value' => system_config('system.cron')->get('threshold.autorun'),
     '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'),
   );
 
@@ -1537,7 +1537,7 @@ function system_cron_settings($form, &$form_state) {
  * @ingroup forms
  */
 function system_cron_settings_submit($form, &$form_state) {
-  config('system.cron')
+  system_config('system.cron')
     ->set('threshold.autorun', $form_state['values']['cron_safe_threshold'])
     ->save();
 }
@@ -1569,7 +1569,7 @@ function system_logging_settings($form, &$form_state) {
   $form['error_level'] = array(
     '#type' => 'radios',
     '#title' => t('Error messages to display'),
-    '#default_value' => config('system.logging')->get('error_level'),
+    '#default_value' => system_config('system.logging')->get('error_level'),
     '#options' => array(
       ERROR_REPORTING_HIDE => t('None'),
       ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'),
@@ -1588,7 +1588,7 @@ function system_logging_settings($form, &$form_state) {
  * @ingroup forms
  */
 function system_logging_settings_submit($form, &$form_state) {
-  config('system.logging')
+  system_config('system.logging')
     ->set('error_level', $form_state['values']['error_level'])
     ->save();
 }
@@ -1601,7 +1601,7 @@ function system_logging_settings_submit($form, &$form_state) {
  */
 function system_performance_settings($form, &$form_state) {
   drupal_add_library('system', 'drupal.system');
-  $config = config('system.performance');
+  $config = system_config('system.performance');
 
   $form['clear_cache'] = array(
     '#type' => 'details',
@@ -1690,7 +1690,7 @@ function system_performance_settings($form, &$form_state) {
  * @ingroup forms
  */
 function system_performance_settings_submit($form, &$form_state) {
-  $config = config('system.performance');
+  $config = system_config('system.performance');
   $config->set('cache.page.enabled', $form_state['values']['cache']);
   $config->set('cache.page.max_age', $form_state['values']['page_cache_maximum_age']);
   $config->set('response.gzip', $form_state['values']['page_compression']);
@@ -1815,7 +1815,7 @@ function system_image_toolkit_settings() {
  * @ingroup forms
  */
 function system_rss_feeds_settings($form, &$form_state) {
-  $rss_config = config('system.rss');
+  $rss_config = system_config('system.rss');
   $form['feed_description'] = array(
     '#type' => 'textarea',
     '#title' => t('Feed description'),
@@ -1850,7 +1850,7 @@ function system_rss_feeds_settings($form, &$form_state) {
  * @ingroup forms
  */
 function system_rss_feeds_settings_submit($form, &$form_state) {
-  config('system.rss')
+  system_config('system.rss')
     ->set('channel.description', $form_state['values']['feed_description'])
     ->set('items.limit', $form_state['values']['feed_default_items'])
     ->set('items.view_mode', $form_state['values']['feed_item_length'])
@@ -1970,7 +1970,7 @@ function system_regional_settings_submit($form, &$form_state) {
  * @see system_site_maintenance_mode_submit()
  */
 function system_site_maintenance_mode($form, &$form_state) {
-  $config = config('system.maintenance');
+  $config = system_config('system.maintenance');
   $form['maintenance_mode'] = array(
     '#type' => 'checkbox',
     '#title' => t('Put site into maintenance mode'),
@@ -1992,7 +1992,7 @@ function system_site_maintenance_mode($form, &$form_state) {
  * @ingroup forms
  */
 function system_site_maintenance_mode_submit($form, &$form_state) {
-  config('system.maintenance')
+  system_config('system.maintenance')
     ->set('enabled', $form_state['values']['maintenance_mode'])
     ->set('message', $form_state['values']['maintenance_mode_message'])
     ->save();
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index e5e1339..464c502 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -7,6 +7,7 @@
 
 use Drupal\Core\Utility\ModuleInfo;
 use Drupal\Core\TypedData\Primitive;
+use Drupal\Core\Config\Context\AdminContext;
 
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Response;
@@ -3365,6 +3366,37 @@ function system_admin_compact_page($mode = 'off') {
 }
 
 /**
+ * Retrieves a configuration object for administration.
+ *
+ * This configuration object will be created using a special configuration
+ * context (config.admin = TRUE) and configuration plug-ins should mostly keep
+ * hands off it and don't override it.
+ *
+ * This is intended for administration forms or any other case when we need to
+ * get / set the configuration data without any overrides, as oppossed to
+ * regular configuration used for runtime operations that may be altered by
+ * plug-ins depending on other page request parameters:
+ *
+ * To get regular configuration objects for the page request use config()
+ * instead of this function.
+ *
+ * @param $name
+ *   The name of the configuration object to retrieve.
+ *
+ * @return Drupal\Core\Config\Config
+ *   A configuration object.
+ *
+ * @see config()
+ */
+function system_config($name) {
+  static $context;
+  if (!isset($context)) {
+    $context = new AdminContext('system.config', drupal_container()->get('config.storage'));
+  }
+  return config($name, $context);
+}
+
+/**
  * Generate a list of tasks offered by a specified module.
  *
  * @param $module
diff --git a/core/modules/user/lib/Drupal/user/UserConfigContext.php b/core/modules/user/lib/Drupal/user/UserConfigContext.php
new file mode 100644
index 0000000..8b3689d
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/UserConfigContext.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\user\UserConfigContext
+ */
+
+namespace Drupal\user;
+
+use Drupal\Core\Config\Context\ObjectContext;
+use Drupal\user\Plugin\Core\Entity\User;
+
+/**
+ * Defines a configuration context object for a user account.
+ */
+class UserConfigContext extends ObjectContext {
+
+  /**
+   * Overrides Drupal\Core\Config\ConfigContext::__construct().
+   *
+   * @param Drupal\user\Plugin\Core\Entity\User $user
+   *   The user object to use in this context.
+   */
+  public function __construct($user) {
+    parent::__construct('user.account', $user);
+  }
+
+}
diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc
index 3668aae..47bdde8 100644
--- a/core/modules/user/user.admin.inc
+++ b/core/modules/user/user.admin.inc
@@ -277,8 +277,8 @@ function user_admin_account_validate($form, &$form_state) {
  * @see user_admin_settings_submit()
  */
 function user_admin_settings($form, &$form_state) {
-  $config = config('user.settings');
-  $mail_config = config('user.mail');
+  $config = system_config('user.settings');
+  $mail_config = system_config('user.mail');
 
   // Settings for anonymous users.
   $form['anonymous_settings'] = array(
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index ec43ade..ca6751a 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -4,6 +4,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\file\Plugin\Core\Entity\File;
 use Drupal\Core\Template\Attribute;
+use Drupal\user\UserConfigContext;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
@@ -853,6 +854,18 @@ function user_format_name($account) {
 }
 
 /**
+ * Implements hook_config_context_info().
+ */
+function user_config_context_info() {
+  return array(
+    'user.account' => array(
+      'title' => t('User account'),
+      'class' => '\Drupal\user\UserConfigContext',
+    ),
+  );
+}
+
+/**
  * Implements hook_template_preprocess_default_variables_alter().
  *
  * @see user_user_login()
@@ -1989,35 +2002,23 @@ function user_view_multiple($accounts, $view_mode = 'full', $langcode = NULL) {
 function user_mail($key, &$message, $params) {
   $langcode = $message['langcode'];
   $variables = array('user' => $params['account']);
-  $message['subject'] .= _user_mail_text($key . '.subject', $langcode, $variables);
-  $message['body'][] = _user_mail_text($key . '.body', $langcode, $variables);
-}
 
-/**
- * Returns a mail string for a variable name.
- *
- * @param string $key
- *   The config key that provides the mail text.
- * @param string $langcode
- *   (optional) A language code to use to generate the e-mail text.
- * @param array $variables
- *   (optional) An array of token keys and values.
- *
- * @return
- *   A string value containing the text for the user.mail config key.
- */
-function _user_mail_text($key, $langcode = NULL, $variables = array()) {
+  // Get configuration objects customized for this user, that may be localized
+  // for the user's language if the locale module is enabled.
+  $mail_config = config('user.mail', new UserConfigContext($params['account']));
+
   // We do not sanitize the token replacement, since the output of this
   // replacement is intended for an e-mail message, not a web browser.
-  return token_replace(config('user.mail')->get($key), $variables, array('langcode' => $langcode, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE));
+  $token_options = array('langcode' => $langcode, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE);
+  $message['subject'] .= token_replace($mail_config->get($key . '.subject'), $variables, $token_options);
+  $message['body'][] = token_replace($mail_config->get($key . '.body'), $variables, $token_options);
 }
 
 /**
  * Token callback to add unsafe tokens for user mails.
  *
- * This function is used by the token_replace() call at the end of
- * _user_mail_text() to set up some additional tokens that can be
- * used in email messages generated by user_mail().
+ * This function is used by the token_replace() to set up some additional
+ * tokens that can be used in email messages generated by user_mail().
  *
  * @param $replacements
  *   An associative array variable containing mappings from token names to
