From de497be86c58bbbbf11f8dec7318061d85bf4f37 Mon Sep 17 00:00:00 2001
From: Helmut Hummel <typo3@helhum.io>
Date: Sun, 24 Dec 2017 01:24:09 +0100
Subject: [PATCH] [BUGFIX] Change deprecation of language:update command

Keep the nice and concise name instead of the long and clumsy name.
Also set an alias instead of registering the command twice.

Releases: master
Resolves: #82315
Change-Id: I302977702e2d09f1377f078af2f8b60f515cce1e
Reviewed-on: https://review.typo3.org/55205
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Benni Mack <benni@typo3.org>
---
 ...ecation-82315-DeprecateBinTypo3LanguageUpdate.rst | 12 ++++++------
 .../lang/Classes/Command/LanguageUpdateCommand.php   |  9 ++++-----
 typo3/sysext/lang/Configuration/Commands.php         |  5 +----
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/typo3/sysext/core/Documentation/Changelog/9.0/Deprecation-82315-DeprecateBinTypo3LanguageUpdate.rst b/typo3/sysext/core/Documentation/Changelog/9.0/Deprecation-82315-DeprecateBinTypo3LanguageUpdate.rst
index e603b2233e22..c93e09974a71 100644
--- a/typo3/sysext/core/Documentation/Changelog/9.0/Deprecation-82315-DeprecateBinTypo3LanguageUpdate.rst
+++ b/typo3/sysext/core/Documentation/Changelog/9.0/Deprecation-82315-DeprecateBinTypo3LanguageUpdate.rst
@@ -1,28 +1,28 @@
 .. include:: ../../Includes.txt
 
-=========================================================
-Deprecation: #82315 - Deprecate bin/typo3 language:update
-=========================================================
+==============================================================
+Deprecation: #82315 - Deprecate bin/typo3 lang:language:update
+==============================================================
 
 See :issue:`82315`
 
 Description
 ===========
 
-The command `language:update` is an alias of `lang:language:update`, therefore it's superfluous and
+The command `lang:language:update` is an alias of `language:update`, therefore it's superfluous and
 will be removed in the future.
 
 
 Impact
 ======
 
-The command `language:update` will not work any more.
+The command `lang:language:update` will show a deprecation message when used.
 
 
 Affected Installations
 ======================
 
-All installations that make use of the command `language:update`. Most likely there are cronjobs
+All installations that make use of the command `lang:language:update`. Most likely there are cronjobs
 that need to be adjusted.
 
 
diff --git a/typo3/sysext/lang/Classes/Command/LanguageUpdateCommand.php b/typo3/sysext/lang/Classes/Command/LanguageUpdateCommand.php
index 7a3f966136e6..fffb9dad27f0 100644
--- a/typo3/sysext/lang/Classes/Command/LanguageUpdateCommand.php
+++ b/typo3/sysext/lang/Classes/Command/LanguageUpdateCommand.php
@@ -56,9 +56,8 @@ class LanguageUpdateCommand extends Command
      */
     protected function configure()
     {
-        $description = ($this->getName() === 'language:update')
-            ? '[Deprecated] Use lang:language:update instead'
-            : 'Update the language files of all activated extensions';
+        $this->setAliases(['lang:language:update']);
+        $description = 'Update the language files of all activated extensions';
 
         $this
             ->setDescription($description)
@@ -79,8 +78,8 @@ class LanguageUpdateCommand extends Command
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
-        if ($this->getName() === 'language:update') {
-            $message = 'bin/typo3 language:update is deprecated, use bin/typo3 lang:language:update instead';
+        if (substr_count($input->getArgument('command'), ':') === 2) {
+            $message = 'bin/typo3 lang:language:update is deprecated, use bin/typo3 language:update instead';
             $output->writeln('<error>' . $message . '</error>');
             trigger_error($message, E_USER_DEPRECATED);
         }
diff --git a/typo3/sysext/lang/Configuration/Commands.php b/typo3/sysext/lang/Configuration/Commands.php
index 39d8b7a0fc95..8a4dcf3a6816 100644
--- a/typo3/sysext/lang/Configuration/Commands.php
+++ b/typo3/sysext/lang/Configuration/Commands.php
@@ -5,12 +5,9 @@
  * Required parameter is the "class" of the command which needs to be a subclass
  * of Symfony/Console/Command.
  *
- * example: bin/typo3 lang:language:update
+ * example: bin/typo3 language:update
  */
 return [
-    'lang:language:update' => [
-        'class' => \TYPO3\CMS\Lang\Command\LanguageUpdateCommand::class
-    ],
     'language:update' => [
         'class' => \TYPO3\CMS\Lang\Command\LanguageUpdateCommand::class
     ]
-- 
GitLab