diff options
author | Sasa Zivkov <sasa.zivkov@sap.com> | 2010-05-19 16:59:28 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-05-19 14:37:16 -0700 |
commit | f3d8a8ecad614906a2c4ec0077cdb24129da6c6d (patch) | |
tree | 34d041692beff0f392c27869f49b76c0fc2053e6 /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java | |
parent | 2e961989e42b1fe7e8bd9eaa7a3d2e88a0d1d001 (diff) | |
download | jgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.tar.gz jgit-f3d8a8ecad614906a2c4ec0077cdb24129da6c6d.zip |
Externalize strings from JGit
The strings are externalized into the root resource bundles.
The resource bundles are stored under the new "resources" source
folder to get proper maven build.
Strings from tests are, in general, not externalized. Only in
cases where it was necessary to make the test pass the strings
were externalized. This was typically necessary in cases where
e.getMessage() was used in assert and the exception message was
slightly changed due to reuse of the externalized strings.
Change-Id: Ic0f29c80b9a54fcec8320d8539a3e112852a1f7b
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java index 1e03567500..b572e0092b 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java @@ -3,6 +3,7 @@ * Copyright (C) 2008-2010, Google Inc. * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com> * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> + * Copyright (C) 2010, Sasa Zivkov <sasa.zivkov@sap.com> * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -46,6 +47,8 @@ package org.eclipse.jgit.pgm; +import java.io.PrintWriter; + import org.kohsuke.args4j.Option; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; @@ -55,7 +58,7 @@ import org.eclipse.jgit.transport.TrackingRefUpdate; import org.eclipse.jgit.transport.Transport; abstract class AbstractFetchCommand extends TextBuiltin { - @Option(name = "--verbose", aliases = { "-v" }, usage = "be more verbose") + @Option(name = "--verbose", aliases = { "-v" }, usage = "usage_beMoreVerbose") private boolean verbose; protected void showFetchResult(final Transport tn, final FetchResult r) { @@ -70,8 +73,7 @@ abstract class AbstractFetchCommand extends TextBuiltin { final String dst = abbreviateRef(u.getLocalName(), true); if (!shownURI) { - out.print("From "); - out.print(tn.getURI()); + out.format(CLIText.get().fromURI, tn.getURI()); out.println(); shownURI = true; } @@ -84,6 +86,7 @@ abstract class AbstractFetchCommand extends TextBuiltin { } static void showRemoteMessages(String pkt) { + PrintWriter writer = new PrintWriter(System.err); while (0 < pkt.length()) { final int lf = pkt.indexOf('\n'); final int cr = pkt.indexOf('\r'); @@ -95,18 +98,22 @@ abstract class AbstractFetchCommand extends TextBuiltin { else if (0 <= cr) s = cr; else { - System.err.println("remote: " + pkt); + writer.format(CLIText.get().remoteMessage, pkt); + writer.println(); break; } - if (pkt.charAt(s) == '\r') - System.err.print("remote: " + pkt.substring(0, s) + "\r"); - else - System.err.println("remote: " + pkt.substring(0, s)); + if (pkt.charAt(s) == '\r') { + writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); + writer.print('\r'); + } else { + writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); + writer.println(); + } pkt = pkt.substring(s + 1); } - System.err.flush(); + writer.flush(); } private String longTypeOf(final TrackingRefUpdate u) { |