diff --git a/cli/src/main/java/hudson/cli/CLI.java b/cli/src/main/java/hudson/cli/CLI.java index fa62fa552067df9c6cca85bed98ae29ba5de250b..152aac469ee7c358ad1b75a815ced2210d22b63d 100644 --- a/cli/src/main/java/hudson/cli/CLI.java +++ b/cli/src/main/java/hudson/cli/CLI.java @@ -29,6 +29,7 @@ import hudson.remoting.RemoteOutputStream; import hudson.remoting.PingThread; import hudson.remoting.SocketInputStream; import hudson.remoting.SocketOutputStream; +import hudson.cli.client.Messages; import java.net.URL; import java.net.URLConnection; diff --git a/cli/src/main/resources/hudson/cli/Messages.properties b/cli/src/main/resources/hudson/cli/client/Messages.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages.properties rename to cli/src/main/resources/hudson/cli/client/Messages.properties diff --git a/cli/src/main/resources/hudson/cli/Messages_da.properties b/cli/src/main/resources/hudson/cli/client/Messages_da.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages_da.properties rename to cli/src/main/resources/hudson/cli/client/Messages_da.properties diff --git a/cli/src/main/resources/hudson/cli/Messages_de.properties b/cli/src/main/resources/hudson/cli/client/Messages_de.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages_de.properties rename to cli/src/main/resources/hudson/cli/client/Messages_de.properties diff --git a/cli/src/main/resources/hudson/cli/Messages_es.properties b/cli/src/main/resources/hudson/cli/client/Messages_es.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages_es.properties rename to cli/src/main/resources/hudson/cli/client/Messages_es.properties diff --git a/cli/src/main/resources/hudson/cli/Messages_ja.properties b/cli/src/main/resources/hudson/cli/client/Messages_ja.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages_ja.properties rename to cli/src/main/resources/hudson/cli/client/Messages_ja.properties diff --git a/cli/src/main/resources/hudson/cli/Messages_pt_BR.properties b/cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties similarity index 100% rename from cli/src/main/resources/hudson/cli/Messages_pt_BR.properties rename to cli/src/main/resources/hudson/cli/client/Messages_pt_BR.properties diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 4616e823a9b54d2f924b48cbf2258d36efb7781f..10fdb153e003d75c03753e6f773d5ee9e7dffd47 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -72,7 +72,7 @@ public class InstallPluginCommand extends CLICommand { // is this a file? FilePath f = new FilePath(channel, source); if (f.exists()) { - stdout.println("Installing a plugin from local file: "+f); + stdout.println(Messages.InstallPluginCommand_InstallingPluginFromLocalFile(f)); if (name==null) name = f.getBaseName(); f.copyTo(getTargetFile()); @@ -82,7 +82,7 @@ public class InstallPluginCommand extends CLICommand { // is this an URL? try { URL u = new URL(source); - stdout.println("Installing a plugin from "+u); + stdout.println(Messages.InstallPluginCommand_InstallingPluginFromUrl(u)); if (name==null) { name = u.getPath(); name = name.substring(name.indexOf('/')+1); @@ -99,26 +99,26 @@ public class InstallPluginCommand extends CLICommand { // is this a plugin the update center? UpdateSite.Plugin p = h.getUpdateCenter().getPlugin(source); if (p!=null) { - stdout.println("Installing "+source+" from update center"); + stdout.println(Messages.InstallPluginCommand_InstallingFromUpdateCenter(source)); p.deploy().get(); continue; } - stdout.println(source+" is neither a valid file, URL, nor a plugin artifact name in the update center"); + stdout.println(Messages.InstallPluginCommand_NotAValidSourceName(source)); if (!source.contains(".") && !source.contains(":") && !source.contains("/") && !source.contains("\\")) { // looks like a short plugin name. Why did we fail to find it in the update center? if (h.getUpdateCenter().getSites().isEmpty()) { - stdout.println("Note that no update center is defined in this Hudson."); + stdout.println(Messages.InstallPluginCommand_NoUpdateCenterDefined()); } else { Set candidates = new HashSet(); for (UpdateSite s : h.getUpdateCenter().getSites()) { Data dt = s.getData(); if (dt==null) - stdout.println("No update center data is retrieved yet from: "+s.getUrl()); + stdout.println(Messages.InstallPluginCommand_NoUpdateDataRetrieved(s.getUrl())); candidates.addAll(dt.plugins.keySet()); } - stdout.println(source+" looks like a short plugin name. Did you mean '"+ EditDistance.findNearest(source,candidates)+"'?"); + stdout.println(Messages.InstallPluginCommand_DidYouMean(source,EditDistance.findNearest(source,candidates))); } } diff --git a/core/src/main/resources/hudson/cli/Messages.properties b/core/src/main/resources/hudson/cli/Messages.properties new file mode 100644 index 0000000000000000000000000000000000000000..b9af919185e1f7dbdcd97739a46d2943e1b25923 --- /dev/null +++ b/core/src/main/resources/hudson/cli/Messages.properties @@ -0,0 +1,7 @@ +InstallPluginCommand.DidYouMean={0} looks like a short plugin name. Did you mean ''{1}''? +InstallPluginCommand.InstallingFromUpdateCenter=Installing {0} from update center +InstallPluginCommand.InstallingPluginFromLocalFile=Installing a plugin from local file: {0} +InstallPluginCommand.InstallingPluginFromUrl=Installing a plugin from {0} +InstallPluginCommand.NoUpdateCenterDefined=Note that no update center is defined in this Hudson. +InstallPluginCommand.NoUpdateDataRetrieved=No update center data is retrieved yet from: {0} +InstallPluginCommand.NotAValidSourceName={0} is neither a valid file, URL, nor a plugin artifact name in the update center \ No newline at end of file