diff --git a/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperInterface.php b/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperInterface.php
index b572708..45214ee 100644
--- a/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperInterface.php
+++ b/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperInterface.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Language\Language;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Route;
 
 /**
  * Defines an interface for configuration mapper.
@@ -47,6 +48,14 @@ public function getBaseRouteParameters();
   public function getBaseRoute();
 
   /**
+   * Sets the base route object.
+   *
+   * @param \Symfony\Component\Routing\Route $route
+   *   The route object used as base route.
+   */
+  public function setBaseRoute(Route $route);
+
+  /**
    * Returns a processed path for the base route the mapper is attached to.
    *
    * @return string
diff --git a/core/modules/config_translation/lib/Drupal/config_translation/ConfigNamesMapper.php b/core/modules/config_translation/lib/Drupal/config_translation/ConfigNamesMapper.php
index 2df7387..3f6a208 100644
--- a/core/modules/config_translation/lib/Drupal/config_translation/ConfigNamesMapper.php
+++ b/core/modules/config_translation/lib/Drupal/config_translation/ConfigNamesMapper.php
@@ -91,14 +91,13 @@ class ConfigNamesMapper extends PluginBase implements ConfigMapperInterface, Con
   public function __construct($plugin_id, array $plugin_definition, ConfigFactory $config_factory, LocaleConfigManager $locale_config_manager, ConfigMapperManagerInterface $config_mapper_manager, RouteProviderInterface $route_provider, TranslationInterface $translation_manager) {
     $this->pluginId = $plugin_id;
     $this->pluginDefinition = $plugin_definition;
+    $this->routeProvider = $route_provider;
 
     $this->configFactory = $config_factory;
     $this->localeConfigManager = $locale_config_manager;
     $this->configMapperManager = $config_mapper_manager;
 
     $this->setTranslationManager($translation_manager);
-
-    $this->baseRoute = $route_provider->getRouteByName($this->getBaseRouteName());
   }
 
   /**
@@ -145,12 +144,22 @@ public function getBaseRouteParameters() {
    * {@inheritdoc}
    */
   public function getBaseRoute() {
+    if (!isset($this->baseRoute)) {
+      $this->baseRoute = $this->routeProvider->getRouteByName($this->getBaseRouteName());
+    }
     return $this->baseRoute;
   }
 
   /**
    * {@inheritdoc}
    */
+  public function setBaseRoute(Route $route) {
+    $this->baseRoute = $route;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getBasePath() {
     return $this->getPathFromRoute($this->getBaseRoute(), $this->getBaseRouteParameters());
   }
diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php b/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php
index 335faa5..fc795d7 100644
--- a/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php
+++ b/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Routing\RouteSubscriberBase;
 use Drupal\config_translation\ConfigMapperManagerInterface;
+use Drupal\Core\Routing\RoutingEvents;
 use Symfony\Component\Routing\RouteCollection;
 
 /**
@@ -31,21 +32,30 @@ class RouteSubscriber extends RouteSubscriberBase {
    */
   public function __construct(ConfigMapperManagerInterface $mapper_manager) {
     $this->mapperManager = $mapper_manager;
+
+    $this->mappers = $this->mapperManager->getMappers();
+    $this->neededMapperBaseRoutes = array();
+    $this->baseRoutesMapping = array();
+    foreach ($this->mappers as $id => $mapper) {
+      $this->neededMapperBaseRoutes[$id] = $mapper->getBaseRouteName();
+    }
   }
 
   /**
    * {@inheritdoc}
    */
   protected function alterRoutes(RouteCollection $collection, $provider) {
-    // @todo \Drupal\config_translation\ConfigNamesMapper uses the route
-    //   provider directly, which is unsafe during rebuild. This currently only
-    //   works by coincidence; fix in https://drupal.org/node/2158571.
-    if ($provider != 'dynamic_routes') {
-      return;
+    foreach ($this->neededMapperBaseRoutes as $mapper_id => $route_name) {
+      if ($route = $collection->get($route_name)) {
+        $this->baseRoutesMapping[$mapper_id] = $route;
+      }
     }
 
-    $mappers = $this->mapperManager->getMappers();
-    foreach ($mappers as $mapper) {
+    foreach ($this->mappers as $id => $mapper) {
+      if (!isset($this->baseRoutesMapping[$id])) {
+        throw new \Exception('No freaking idea: ');
+      }
+      $mapper->setBaseRoute($this->baseRoutesMapping[$id]);
       $collection->add($mapper->getOverviewRouteName(), $mapper->getOverviewRoute());
       $collection->add($mapper->getAddRouteName(), $mapper->getAddRoute());
       $collection->add($mapper->getEditRouteName(), $mapper->getEditRoute());
@@ -53,4 +63,14 @@ protected function alterRoutes(RouteCollection $collection, $provider) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    $events = parent::getSubscribedEvents();
+    $events[RoutingEvents::DYNAMIC] = array('onDynamicRoutes', -10);
+
+    return $events;
+  }
+
 }
