From 072ad087ff274ed8e0bee2fc941ced3d82ff6f4f Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 28 May 2010 09:44:10 -0700 Subject: [PATCH] Externalize strings in Commit command Change-Id: I08b2cdd147ad6f3c67795f2e75a5b5d2ce2fb20f Signed-off-by: Shawn O. Pearce --- .../resources/org/eclipse/jgit/pgm/CLIText.properties | 5 +++++ .../src/org/eclipse/jgit/pgm/CLIText.java | 1 + org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties index edf31e97be..d13c47d297 100644 --- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties +++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/CLIText.properties @@ -8,6 +8,7 @@ N=N IPZillaPasswordPrompt=IPZilla Password authorInfo=Author: {0} <{1}> averageMSPerRead=average {0} ms/read +branchDetachedHEAD=detached HEAD branchAlreadyExists=branch {0} already exists branchCreatedFrom =branch: Created from {0} branchIsNotAnAncestorOfYourCurrentHEAD=The branch '{0}' is not an ancestor of your current HEAD.\nIf you are sure you want to delete it, run 'jgit branch -D {0}'. @@ -54,6 +55,7 @@ listeningOn=Listening on {0} metaVar_DAG=DAG metaVar_KEY=KEY metaVar_arg=ARG +metaVar_author=AUTHOR metaVar_base=base metaVar_bucket=BUCKET metaVar_command=command @@ -110,6 +112,8 @@ skippingObject=skipping {0} {1} timeInMilliSeconds={0} ms tooManyRefsGiven=Too many refs given unsupportedOperation=Unsupported operation: {0} +usage_CommitAuthor=Override the author name used in the commit. You can use the standard A U Thor format. +usage_CommitMessage=Use the given as the commit message usage_CommandLineClientForamazonsS3Service=Command line client for Amazon's S3 service usage_CreateABareRepository=Create a bare repository usage_CreateATag=Create a tag @@ -163,6 +167,7 @@ usage_portNumberToListenOn=port number to listen on usage_produceAnEclipseIPLog=Produce an Eclipse IP log usage_pruneStaleTrackingRefs=prune stale tracking refs usage_recurseIntoSubtrees=recurse into subtrees +usage_recordChangesToRepository=Record changes to the repository usage_setTheGitRepositoryToOperateOn=set the git repository to operate on usage_showRefNamesMatchingCommits=Show ref names matching commits usage_symbolicVersionForTheProject=Symbolic version for the project diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java index 8c811d4ef7..bae895cc76 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java @@ -63,6 +63,7 @@ public class CLIText extends TranslationBundle { /***/ public String averageMSPerRead; /***/ public String branchAlreadyExists; /***/ public String branchCreatedFrom; + /***/ public String branchDetachedHEAD; /***/ public String branchIsNotAnAncestorOfYourCurrentHEAD; /***/ public String branchNotFound; /***/ public String cacheTreePathInfo; diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java index 36e1a73392..b26dde3a4a 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java @@ -49,15 +49,15 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.revwalk.RevCommit; import org.kohsuke.args4j.Option; -@Command(common = true, usage = "Record changes to the repository") +@Command(common = true, usage = "usage_recordChangesToRepository") class Commit extends TextBuiltin { // I don't support setting the committer, because also the native git // command doesn't allow this. - @Option(name = "--author", metaVar="author", usage = "Override the author name used in the commit. You can use the standard A U Thor format.") + @Option(name = "--author", metaVar="metaVar_author", usage = "usage_CommitAuthor") private String author; - @Option(name = "--message", aliases = { "-m" }, metaVar="msg", usage="Use the given as the commit message", required=true) + @Option(name = "--message", aliases = { "-m" }, metaVar="metaVar_message", usage="usage_CommitMessage", required=true) private String message; @Override @@ -73,7 +73,7 @@ class Commit extends TextBuiltin { String branchName; if (!head.isSymbolic()) - branchName="detached HEAD"; + branchName = CLIText.get().branchDetachedHEAD; else { branchName = head.getTarget().getName(); if (branchName.startsWith(Constants.R_HEADS)) -- 2.39.5