From f949fb884e951380f26ce69a324c77f1f116fea7 Mon Sep 17 00:00:00 2001 From: William Li Date: Thu, 29 Mar 2018 17:07:24 -0700 Subject: [PATCH] Show version guide only when restore fails --- .../dotnet-tool/install/LocalizableStrings.resx | 5 ++++- .../ToolInstallCommandLowLevelErrorConverter.cs | 2 +- .../install/xlf/LocalizableStrings.cs.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.de.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.es.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.fr.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.it.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.ja.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.ko.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.pl.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.pt-BR.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.ru.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.tr.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.zh-Hans.xlf | 13 ++++++++++--- .../install/xlf/LocalizableStrings.zh-Hant.xlf | 13 ++++++++++--- .../CommandTests/ToolInstallCommandTests.cs | 2 +- 16 files changed, 136 insertions(+), 42 deletions(-) diff --git a/src/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx b/src/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx index af448e1e9..9705509b6 100644 --- a/src/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx @@ -161,6 +161,9 @@ Tool '{1}' (version '{2}') was successfully installed. The settings file in the tool's NuGet package is invalid: {0} + Tool '{0}' failed to install. + + Tool '{0}' failed to install. You may need to specify the version using dotnet tool install -g {0} --version <version> @@ -189,4 +192,4 @@ Tool '{1}' (version '{2}') was successfully installed. Location where the tool will be installed. - \ No newline at end of file + diff --git a/src/dotnet/commands/dotnet-tool/install/ToolInstallCommandLowLevelErrorConverter.cs b/src/dotnet/commands/dotnet-tool/install/ToolInstallCommandLowLevelErrorConverter.cs index e1596b0bb..b73409a32 100644 --- a/src/dotnet/commands/dotnet-tool/install/ToolInstallCommandLowLevelErrorConverter.cs +++ b/src/dotnet/commands/dotnet-tool/install/ToolInstallCommandLowLevelErrorConverter.cs @@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Tools.Tool.Install userFacingMessages = new[] { ex.Message, - string.Format(LocalizableStrings.ToolInstallationFailed, packageId), + string.Format(LocalizableStrings.ToolInstallationFailedWithExplicitVersionGuide, packageId), }; } else if (ex is ToolConfigurationException) diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.cs.xlf index 6d683ff31..be64b6196 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.cs.xlf @@ -60,9 +60,7 @@ Nástroj {1} (verze {2}) byl úspěšně nainstalován. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Nástroj {0} se nepodařilo nainstalovat. @@ -121,6 +119,15 @@ Nástroj {1} (verze {2}) byl úspěšně nainstalován. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.de.xlf index c96dd1df9..af48fbec1 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.de.xlf @@ -60,9 +60,7 @@ Das Tool "{1}" (Version "{2}") wurde erfolgreich installiert. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Fehler bei der Installation des Tools "{0}". @@ -121,6 +119,15 @@ Das Tool "{1}" (Version "{2}") wurde erfolgreich installiert. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.es.xlf index 1978faa6f..87eda641a 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.es.xlf @@ -60,9 +60,7 @@ La herramienta "{1}" (versión "{2}") se instaló correctamente. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. No se pudo instalar la herramienta “{0}”. @@ -121,6 +119,15 @@ La herramienta "{1}" (versión "{2}") se instaló correctamente. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.fr.xlf index fb105c682..55f9420c3 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.fr.xlf @@ -60,9 +60,7 @@ L'outil '{1}' (version '{2}') a été installé. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Impossible d'installer l'outil '{0}'. @@ -121,6 +119,15 @@ L'outil '{1}' (version '{2}') a été installé. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.it.xlf index 972f85489..bf5f5ae38 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.it.xlf @@ -60,9 +60,7 @@ Lo strumento '{1}' (versione '{2}') è stato installato. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Non è stato possibile installare lo strumento '{0}'. @@ -121,6 +119,15 @@ Lo strumento '{1}' (versione '{2}') è stato installato. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ja.xlf index d04d679cd..7bf84f534 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ja.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. ツール '{0}' をインストールできませんでした。 @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ko.xlf index 36543e273..4d66e7b91 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ko.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. '{0}' 도구를 설치하지 못했습니다. @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pl.xlf index 57ac9d21f..523375db0 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pl.xlf @@ -60,9 +60,7 @@ Pomyślnie zainstalowano narzędzie „{1}” (wersja: „{2}”). - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Zainstalowanie narzędzia „{0}” nie powiodło się. @@ -121,6 +119,15 @@ Pomyślnie zainstalowano narzędzie „{1}” (wersja: „{2}”). SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pt-BR.xlf index 961c58a9a..e8cd61fa0 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.pt-BR.xlf @@ -60,9 +60,7 @@ A ferramenta '{1}' (versão '{2}') foi instalada com êxito. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Não foi possível instalar a ferramenta '{0}'. @@ -121,6 +119,15 @@ A ferramenta '{1}' (versão '{2}') foi instalada com êxito. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ru.xlf index f953077a3..516975e49 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.ru.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. Не удалось установить инструмент "{0}". @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.tr.xlf index f596ce661..f90708eba 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.tr.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. '{0}' aracı yüklenemedi. @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hans.xlf index ede31a8f7..d18292849 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hans.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. 工具“{0}”安装失败。 @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hant.xlf index 3c41fffe8..81a2b2f38 100644 --- a/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-tool/install/xlf/LocalizableStrings.zh-Hant.xlf @@ -60,9 +60,7 @@ Tool '{1}' (version '{2}') was successfully installed. - Tool '{0}' failed to install. You may need to specify the version using - - dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. 工具 '{0}' 無法安裝。 @@ -121,6 +119,15 @@ Tool '{1}' (version '{2}') was successfully installed. SOURCE_FEED + + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + Tool '{0}' failed to install. You may need to specify the version using + + dotnet tool install -g {0} --version <version> + + \ No newline at end of file diff --git a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs index 65ea11d13..05cca5f33 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs @@ -360,7 +360,7 @@ namespace Microsoft.DotNet.Tests.Commands a.ShouldThrow().And.Message .Should().Contain( LocalizableStrings.ToolInstallationRestoreFailed + - Environment.NewLine + string.Format(LocalizableStrings.ToolInstallationFailed, PackageId)); + Environment.NewLine + string.Format(LocalizableStrings.ToolInstallationFailedWithExplicitVersionGuide, PackageId)); _fileSystem.Directory.Exists(Path.Combine(PathToPlacePackages, PackageId)).Should().BeFalse(); }