From 8bc71b718137e8eb808dfb974e70ba590e034e36 Mon Sep 17 00:00:00 2001 From: M Ramon Leon Date: Thu, 18 Oct 2018 11:11:10 +0200 Subject: [PATCH] [JENKINS-27177] Improve messages --- core/src/main/java/hudson/PluginManager.java | 5 +---- .../src/main/java/hudson/cli/DisablePluginCommand.java | 1 + core/src/main/resources/hudson/Messages.properties | 10 +++++----- core/src/main/resources/hudson/cli/Messages.properties | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 9659ceb2c4..eccf9337d7 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -1856,10 +1856,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas PluginWrapper plugin = this.getPlugin(pluginName); if (plugin == null) { - PluginWrapper.PluginDisableResult result = new PluginWrapper.PluginDisableResult(pluginName); - result.setMessage(Messages.PluginWrapper_NoSuchPlugin(pluginName)); - result.setStatus(PluginWrapper.PluginDisableStatus.NO_SUCH_PLUGIN); - results.add(result); + results.add(new PluginWrapper.PluginDisableResult(pluginName, PluginWrapper.PluginDisableStatus.NO_SUCH_PLUGIN, Messages.PluginWrapper_NoSuchPlugin(pluginName))); } else { results.add(plugin.disable(strategy)); } diff --git a/core/src/main/java/hudson/cli/DisablePluginCommand.java b/core/src/main/java/hudson/cli/DisablePluginCommand.java index 168b2455f8..36d4b6bd8c 100644 --- a/core/src/main/java/hudson/cli/DisablePluginCommand.java +++ b/core/src/main/java/hudson/cli/DisablePluginCommand.java @@ -120,6 +120,7 @@ public class DisablePluginCommand extends CLICommand { stdout.format(format + "%n", (Object[]) arguments); } else { String[] newArgs = new String[arguments.length + 1]; + newArgs[0] = " "; System.arraycopy(arguments, 0, newArgs, 1, arguments.length); String f = "%" + indent + "s" + format + "%n"; diff --git a/core/src/main/resources/hudson/Messages.properties b/core/src/main/resources/hudson/Messages.properties index cad3dd11ee..57fa82605f 100644 --- a/core/src/main/resources/hudson/Messages.properties +++ b/core/src/main/resources/hudson/Messages.properties @@ -83,10 +83,10 @@ PluginWrapper.disabled={0} is disabled. To fix, enable it. PluginWrapper.obsolete={0} v{1} is older than required. To fix, install v{2} or later. PluginWrapper.obsoleteCore=You must update Jenkins from v{0} to v{1} or later to run this plugin. PluginWrapper.PluginWrapperAdministrativeMonitor.DisplayName=Plugins Failed To Load -PluginWrapper.Already.Disabled=The plugin {0} was already disabled -PluginWrapper.Plugin.Has.Dependant=The plugin {0} has, at least, one dependant plugin ({1}) and the disable strategy is {2}, so it cannot be disabled -PluginWrapper.Plugin.Disabled=Plugin {0} disabled -PluginWrapper.NoSuchPlugin=No such plugin found with the name {0} -PluginWrapper.Error.Disabling=There was an error disabling the {0} plugin. Error: {1} +PluginWrapper.Already.Disabled=The plugin ''{0}'' was already disabled +PluginWrapper.Plugin.Has.Dependant=The plugin ''{0}'' has, at least, one dependant plugin ({1}) and the disable strategy is {2}, so it cannot be disabled +PluginWrapper.Plugin.Disabled=Plugin ''{0}'' disabled +PluginWrapper.NoSuchPlugin=No such plugin found with the name ''{0}'' +PluginWrapper.Error.Disabling=There was an error disabling the ''{0}'' plugin. Error: ''{1}'' TcpSlaveAgentListener.PingAgentProtocol.displayName=Ping protocol diff --git a/core/src/main/resources/hudson/cli/Messages.properties b/core/src/main/resources/hudson/cli/Messages.properties index f8a6f487e1..85bbf56b6d 100644 --- a/core/src/main/resources/hudson/cli/Messages.properties +++ b/core/src/main/resources/hudson/cli/Messages.properties @@ -119,4 +119,4 @@ Disable one or more installed plugins. DisablePluginCommand.NoSuchStrategy=This strategy ({0}) does not exist. Allowed strategies are {1} DisablePluginCommand.PrintUsageSummary=\ Disable the plugins with the given short names. You can define how to proceed with the dependant plugins and if a restart after should be done. You can also set the quiet mode to avoid extra info in the console. -DisablePluginCommand.StatusMessage=Disabling {0}: {1} ({2}) +DisablePluginCommand.StatusMessage=Disabling ''{0}'': {1} ({2})