From 552233373f04e689ddbbc66e325c675c25bea46c Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Tue, 13 Nov 2012 22:41:36 +0000
Subject: [PATCH] Issue #1834250 by plach: Hide Content Translation module
 until we are able to remove it.

---
 core/modules/node/node.module                    | 16 ++++++++++++++++
 .../system/Tests/Module/DependencyTest.php       | 10 +++++-----
 core/modules/translation/translation.info        |  4 ++++
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 541531228397..a6a64aeb212f 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -3870,3 +3870,19 @@ function node_library_info() {
 
   return $libraries;
 }
+
+/**
+ * Implements hook_system_info_alter().
+ *
+ * The Content Translation module is deprecated in Drupal 8 in favor of the
+ * Entity Translation and is planned for removal. Until an upgrade path is
+ * available, it will still be possible to enable it, if necessary, through the
+ * module API or by tweaking the system module list configuration by hand.
+ * Morever every D8 site where Content Translation is installed (not necessarily
+ * enabled) will still be able to see it as usual in the module page.
+ */
+function node_system_info_alter(&$info, $file, $type) {
+  if ($type == 'module' && $file->name == 'translation') {
+    $info['hidden'] = !module_exists('translation') && config('system.module.disabled')->get('translation') === NULL;
+  }
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
index c53d2254f3a8..ebcc11f637db 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
@@ -20,16 +20,16 @@ public static function getInfo() {
   }
 
   /**
-   * Attempts to enable translation module without language enabled.
+   * Attempts to enable the Entity Translation module without Language enabled.
    */
   function testEnableWithoutDependency() {
-    // Attempt to enable content translation without language enabled.
+    // Attempt to enable Entity Translation without Language enabled.
     $edit = array();
-    $edit['modules[Core][translation][enable]'] = 'translation';
+    $edit['modules[Core][translation_entity][enable]'] = 'translation_entity';
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->assertText(t('Some required modules must be enabled'), 'Dependency required.');
 
-    $this->assertModules(array('translation', 'locale', 'language'), FALSE);
+    $this->assertModules(array('translation_entity', 'language'), FALSE);
 
     // Assert that the language tables weren't enabled.
     $this->assertTableCount('language', FALSE);
@@ -37,7 +37,7 @@ function testEnableWithoutDependency() {
     $this->drupalPost(NULL, NULL, t('Continue'));
     $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
 
-    $this->assertModules(array('translation', 'language'), TRUE);
+    $this->assertModules(array('translation_entity', 'language'), TRUE);
 
     // Assert that the language tables were enabled.
     $this->assertTableCount('language', TRUE);
diff --git a/core/modules/translation/translation.info b/core/modules/translation/translation.info
index cc3922f9f47e..01e03f127e7e 100644
--- a/core/modules/translation/translation.info
+++ b/core/modules/translation/translation.info
@@ -1,6 +1,10 @@
 name = Content Translation
 description = Allows content to be translated into different languages.
+dependencies[] = node
 dependencies[] = language
 package = Core
 version = VERSION
 core = 8.x
+; The Content Translation module is deprecated in Drupal 8.
+; See node_system_info_alter().
+hidden = TRUE
-- 
GitLab