]> source.dussan.org Git - jgit.git/commitdiff
Externalize translatable texts in org.eclipse.jgit 53/44053/8
authorMatthias Sohn <matthias.sohn@sap.com>
Tue, 17 Mar 2015 23:32:04 +0000 (00:32 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 26 May 2015 08:52:20 +0000 (10:52 +0200)
Change-Id: Ibf4c299f9d203c78cae79e61f88d4bea60ea2795
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
20 files changed:
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsRepositoryBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/WindowCursor.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectId.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschSession.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportSftp.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
org.eclipse.jgit/src/org/eclipse/jgit/util/io/LimitedInputStream.java

index 6028618598bab1922ad2d15b693cc768d17f565b..f591eddfa33778c039357accc4561d129ecbfcd2 100644 (file)
@@ -27,6 +27,7 @@ badEntryName=Bad entry name: {0}
 badEscape=Bad escape: {0}
 badGroupHeader=Bad group header
 badObjectType=Bad object type: {0}
+badRef=Bad ref: {0}: {1}
 badSectionEntry=Bad section entry: {0}
 bareRepositoryNoWorkdirAndIndex=Bare Repository has neither a working tree, nor an index
 base64InputNotProperlyPadded=Base64 input not properly padded.
@@ -58,16 +59,23 @@ cannotCreateIndexfile=Cannot create an index file with name {0}
 cannotCreateTempDir=Cannot create a temp dir
 cannotDeleteCheckedOutBranch=Branch {0} is checked out and can not be deleted
 cannotDeleteFile=Cannot delete file: {0}
+cannotDeleteObjectsPath="Can't delete {0}/{1}: {2}
 cannotDeleteStaleTrackingRef=Cannot delete stale tracking ref {0}
 cannotDeleteStaleTrackingRef2=Cannot delete stale tracking ref {0}: {1}
 cannotDetermineProxyFor=Cannot determine proxy for {0}
 cannotDownload=Cannot download {0}
+cannotEnterObjectsPath=Can't enter {0}/objects: {1}
+cannotEnterPathFromParent=Can't enter {0} from {1}: {2}
 cannotExecute=cannot execute: {0}
 cannotGet=Cannot get {0}
+cannotGetObjectsPath=Can't get {0}/{1}: {2}
+cannotListObjectsPath=Can't ls {0}/{1}: {2}
+cannotListPackPath=Can't ls {0}/pack: {1}
 cannotListRefs=cannot list refs
 cannotLock=Cannot lock {0}
 cannotLockPackIn=Cannot lock pack in {0}
 cannotMatchOnEmptyString=Cannot match on empty string.
+cannotMkdirObjectPath=Can't mkdir {0}/{1}: {2}
 cannotMoveIndexTo=Cannot move index to {0}
 cannotMovePackTo=Cannot move pack to {0}
 cannotOpenService=cannot open {0}
@@ -80,13 +88,16 @@ cannotReadCommit=Cannot read commit {0}
 cannotReadFile=Cannot read file {0}
 cannotReadHEAD=cannot read HEAD: {0} {1}
 cannotReadObject=Cannot read object
+cannotReadObjectsPath=Cannot read {0}/{1}: {2}
 cannotReadTree=Cannot read tree {0}
 cannotRebaseWithoutCurrentHead=Can not rebase without a current HEAD
 cannotResolveLocalTrackingRefForUpdating=Cannot resolve local tracking ref {0} for updating.
 cannotSquashFixupWithoutPreviousCommit=Cannot {0} without previous commit.
 cannotStoreObjects=cannot store objects
+cannotResolveUniquelyAbbrevObjectId=Could not resolve uniquely the abbreviated object ID
 cannotUnloadAModifiedTree=Cannot unload a modified tree.
 cannotWorkWithOtherStagesThanZeroRightNow=Cannot work with other stages than zero right now. Won't write corrupt index.
+cannotWriteObjectsPath="Can't write {0}/{1}: {2}
 canOnlyCherryPickCommitsWithOneParent=Cannot cherry-pick commit ''{0}'' because it has {1} parents, only commits with exactly one parent are supported.
 canOnlyRevertCommitsWithOneParent=Cannot revert commit ''{0}'' because it has {1} parents, only commits with exactly one parent are supported
 commitDoesNotHaveGivenParent=The commit ''{0}'' does not have a parent number {1}.
@@ -113,26 +124,60 @@ contextMustBeNonNegative=context must be >= 0
 corruptionDetectedReReadingAt=Corruption detected re-reading at {0}
 corruptObjectBadStream=bad stream
 corruptObjectBadStreamCorruptHeader=bad stream, corrupt header
+corruptObjectDuplicateEntryNames=duplicate entry names
 corruptObjectGarbageAfterSize=garbage after size
 corruptObjectIncorrectLength=incorrect length
+corruptObjectIncorrectSorting=incorrectly sorted
+corruptObjectInvalidAuthor=invalid author
+corruptObjectInvalidCommitter=invalid committer
 corruptObjectInvalidEntryMode=invalid entry mode
 corruptObjectInvalidMode=invalid mode
-corruptObjectInvalidMode2=invalid mode {0}
+corruptObjectInvalidModeChar=invalid mode character
+corruptObjectInvalidModeStartsZero=mode starts with '0'
+corruptObjectInvalidMode2=invalid mode {0,number,#}
 corruptObjectInvalidMode3=invalid mode {0} for {1} ''{2}'' in {3}.
+corruptObjectInvalidName=invalid name '%s'
+corruptObjectInvalidNameAux=invalid name 'AUX'
+corruptObjectInvalidNameCon=invalid name 'CON'
+corruptObjectInvalidNameCom=invalid name 'COM%c'
+corruptObjectInvalidNameEnd=invalid name ends with '%c'
+corruptObjectInvalidNameIgnorableUnicode=invalid name '%s' contains ignorable Unicode characters
+corruptObjectInvalidNameInvalidUtf8=invalid name contains byte sequence ''{0}'' which is not a valid UTF-8 character
+corruptObjectInvalidNameLpt=invalid name 'LPT%c'
+corruptObjectInvalidNameNul=invalid name 'NUL'
+corruptObjectInvalidNamePrn=invalid name 'PRN'
+corruptObjectInvalidObject=invalid object
+corruptObjectInvalidParent=invalid parent
+corruptObjectInvalidTagger=invalid tagger
+corruptObjectInvalidTree=invalid tree
 corruptObjectInvalidType=invalid type
 corruptObjectInvalidType2=invalid type {0}
 corruptObjectMalformedHeader=malformed header: {0}
+corruptObjectNameContainsByte=name contains byte 0x%x
+corruptObjectNameContainsChar=name contains '%c'
+corruptObjectNameContainsNullByte=name contains byte 0x00
+corruptObjectNameContainsSlash=name contains '/'
+corruptObjectNameDot=invalid name '.'
+corruptObjectNameDotDot=invalid name '..'
+corruptObjectNameZeroLength=zero length name
 corruptObjectNegativeSize=negative size
 corruptObjectNoAuthor=no author
 corruptObjectNoCommitter=no committer
 corruptObjectNoHeader=no header
 corruptObjectNoObject=no object
+corruptObjectNoObjectHeader=no object header
 corruptObjectNoTaggerBadHeader=no tagger/bad header
 corruptObjectNoTaggerHeader=no tagger header
+corruptObjectNoTagHeader=no tag header
 corruptObjectNoTagName=no tag name
 corruptObjectNotree=no tree
+corruptObjectNotreeHeader=no tree header
 corruptObjectNoType=no type
+corruptObjectNoTypeHeader=no type header
 corruptObjectPackfileChecksumIncorrect=Packfile checksum incorrect.
+corruptObjectTruncatedInMode=truncated in mode
+corruptObjectTruncatedInName=truncated in name
+corruptObjectTruncatedInObjectId=truncated in object id
 couldNotCheckOutBecauseOfConflicts=Could not check out because of conflicts
 couldNotDeleteLockFileShouldNotHappen=Could not delete lock file. Should not happen
 couldNotDeleteTemporaryIndexFileShouldNotHappen=Could not delete temporary index file. Should not happen
@@ -144,6 +189,7 @@ couldNotReadObjectWhileParsingCommit=Could not read an object while parsing comm
 couldNotRenameDeleteOldIndex=Could not rename delete old index
 couldNotRenameTemporaryFile=Could not rename temporary file {0} to new location {1}
 couldNotRenameTemporaryIndexFileToIndex=Could not rename temporary index file to index
+couldNotRewindToUpstreamCommit=Could not rewind to upstream commit
 couldNotURLEncodeToUTF8=Could not URL encode to UTF-8
 couldNotWriteFile=Could not write file {0}
 countingObjects=Counting objects
@@ -180,6 +226,7 @@ duplicateStagesNotAllowed=Duplicate stages not allowed
 eitherGitDirOrWorkTreeRequired=One of setGitDir or setWorkTree must be called.
 emptyCommit=No changes
 emptyPathNotPermitted=Empty path not permitted.
+emptyRef=Empty ref: {0}
 encryptionError=Encryption error: {0}
 endOfFileInEscape=End of file in escape
 entryNotFoundByPath=Entry not found by path: {0}
@@ -240,6 +287,7 @@ funnyRefname=funny refname
 gcFailed=Garbage collection failed.
 gitmodulesNotFound=.gitmodules not found in tree.
 headRequiredToStash=HEAD required to stash local changes
+hiddenFilesStartWithDot=Hiding only allowed for names that start with a period
 hoursAgo={0} hours ago
 hugeIndexesAreNotSupportedByJgitYet=Huge indexes are not supported by jgit, yet
 hunkBelongsToAnotherFile=Hunk belongs to another file
@@ -276,8 +324,9 @@ invalidCommitParentNumber=Invalid commit parent number
 invalidEncryption=Invalid encryption
 invalidGitdirRef = Invalid .git reference in file ''{0}''
 invalidGitType=invalid git type: {0}
-invalidId=Invalid id {0}
+invalidId=Invalid id: {0}
 invalidIdLength=Invalid id length {0}; should be {1}
+invalidIgnoreParamSubmodule=Found invalid ignore param for submodule {0}.
 invalidIntegerValue=Invalid integer value: {0}.{1}={2}
 invalidKey=Invalid key: {0}
 invalidLineInConfigFile=Invalid line in config file
@@ -310,8 +359,10 @@ largeObjectException={0} exceeds size limit
 largeObjectOutOfMemory=Out of memory loading {0}
 lengthExceedsMaximumArraySize=Length exceeds maximum array size
 listingAlternates=Listing alternates
+listingPacks=Listing packs
 localObjectsIncomplete=Local objects incomplete.
 localRefIsMissingObjects=Local ref {0} is missing object(s).
+localRepository=local repository
 lockCountMustBeGreaterOrEqual1=lockCount must be >= 1
 lockError=lock error: {0}
 lockOnNotClosed=Lock on {0} not closed.
@@ -410,6 +461,8 @@ pathIsNotInWorkingDir=Path is not in working dir
 pathNotConfigured=Submodule path is not configured
 peeledLineBeforeRef=Peeled line before ref.
 peerDidNotSupplyACompleteObjectGraph=peer did not supply a complete object graph
+personIdentEmailNonNull=E-mail address of PersonIdent must not be null.
+personIdentNameNonNull=Name of PersonIdent must not be null.
 prefixRemote=remote: 
 problemWithResolvingPushRefSpecsLocally=Problem with resolving push ref specs locally: {0}
 progressMonUploading=Uploading {0}
@@ -453,6 +506,7 @@ repositoryConfigFileInvalid=Repository config file {0} invalid {1}
 repositoryIsRequired=Repository is required.
 repositoryNotFound=repository not found: {0}
 repositoryState_applyMailbox=Apply mailbox
+repositoryState_bare=Bare
 repositoryState_bisecting=Bisecting
 repositoryState_conflicts=Conflicts
 repositoryState_merged=Merged
@@ -466,6 +520,9 @@ resettingHead=Resetting head to {0}
 resolvingDeltas=Resolving deltas
 resultLengthIncorrect=result length incorrect
 rewinding=Rewinding to commit {0}
+s3ActionDeletion=Deletion
+s3ActionReading=Reading
+s3ActionWriting=Writing
 searchForReuse=Finding sources
 searchForSizes=Getting sizes
 secondsAgo={0} seconds ago
@@ -547,6 +604,7 @@ unableToWrite=Unable to write {0}
 unencodeableFile=Unencodable file: {0}
 unexpectedCompareResult=Unexpected metadata comparison result: {0}
 unexpectedEndOfConfigFile=Unexpected end of config file
+unexpectedEndOfInput=Unexpected end of input
 unexpectedHunkTrailer=Unexpected hunk trailer
 unexpectedOddResult=odd: {0} + {1} - {2}
 unexpectedRefReport={0}: unexpected ref report: {1}
@@ -558,6 +616,7 @@ unknownHost=unknown host
 unknownIndexVersionOrCorruptIndex=Unknown index version (or corrupt index): {0}
 unknownObject=unknown object
 unknownObjectType=Unknown object type {0}.
+unknownObjectType2=unknown
 unknownRepositoryFormat=Unknown repository format
 unknownRepositoryFormat2=Unknown repository format "{0}"; expected "0".
 unknownZlibError=Unknown zlib error.
@@ -566,16 +625,21 @@ unmergedPaths=Repository contains unmerged paths
 unpackException=Exception while parsing pack stream
 unreadablePackIndex=Unreadable pack index: {0}
 unrecognizedRef=Unrecognized ref: {0}
+unsetMark=Mark not set
+unsupportedAlternates=Alternates not supported
 unsupportedArchiveFormat=Unknown archive format ''{0}''
 unsupportedCommand0=unsupported command 0
 unsupportedEncryptionAlgorithm=Unsupported encryption algorithm: {0}
 unsupportedEncryptionVersion=Unsupported encryption version: {0}
 unsupportedGC=Unsupported garbage collector for repository type: {0}
+unsupportedMark=Mark not supported
 unsupportedOperationNotAddAtEnd=Not add-at-end: {0}
 unsupportedPackIndexVersion=Unsupported pack index version {0}
 unsupportedPackVersion=Unsupported pack version {0}.
+updatingHeadFailed=Updating HEAD failed
 updatingReferences=Updating references
 updatingRefFailed=Updating the ref {0} to {1} failed. ReturnCode from RefUpdate.update() was {2}
+upstreamBranchName=branch ''{0}'' of {1}
 uriNotConfigured=Submodule URI not configured
 uriNotFound={0} not found
 URINotSupported=URI not supported: {0}
index cdaf3ec97ebe7ae57e257ab5b062d061fa67f9d2..ac050dd331d3a05b037932012b824b782805e89e 100644 (file)
@@ -261,7 +261,7 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
                        fetchRes = fetch.call();
                } else {
                        // we can skip the fetch altogether
-                       remoteUri = "local repository";
+                       remoteUri = JGitText.get().localRepository;
                        fetchRes = null;
                }
 
@@ -302,9 +302,9 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
                        }
                }
 
-               String upstreamName = "branch \'"
-                               + Repository.shortenRefName(remoteBranchName) + "\' of "
-                               + remoteUri;
+               String upstreamName = MessageFormat.format(
+                               JGitText.get().upstreamBranchName,
+                               Repository.shortenRefName(remoteBranchName), remoteUri);
 
                PullResult result;
                if (pullRebaseMode.rebase) {
index a11822975ae45288b8212c438341d64aff5a222e..7196a2f386510aa165e30b6c5c43eb8e47f66f14 100644 (file)
@@ -445,7 +445,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                Collection<ObjectId> ids = or.resolve(step.getCommit());
                if (ids.size() != 1)
                        throw new JGitInternalException(
-                                       "Could not resolve uniquely the abbreviated object ID");
+                                       JGitText.get().cannotResolveUniquelyAbbrevObjectId);
                RevCommit commitToPick = walk.parseCommit(ids.iterator().next());
                if (shouldPick) {
                        if (monitor.isCancelled())
@@ -887,7 +887,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        case NO_CHANGE:
                                break;
                        default:
-                               throw new JGitInternalException("Updating HEAD failed");
+                               throw new JGitInternalException(
+                                               JGitText.get().updatingHeadFailed);
                        }
                        rup = repo.updateRef(Constants.HEAD);
                        rup.setRefLogMessage("rebase finished: returning to " + headName, //$NON-NLS-1$
@@ -899,7 +900,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        case NO_CHANGE:
                                break;
                        default:
-                               throw new JGitInternalException("Updating HEAD failed");
+                               throw new JGitInternalException(
+                                               JGitText.get().updatingHeadFailed);
                        }
                }
        }
@@ -1291,7 +1293,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                                if (this.upstreamCommit == null)
                                        throw new JGitInternalException(MessageFormat
                                                        .format(JGitText.get().missingRequiredParameter,
-                                                                       "upstream"));
+                                                                       "upstream")); //$NON-NLS-1$
                                return;
                        default:
                                throw new WrongRepositoryStateException(MessageFormat.format(
@@ -1398,7 +1400,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
                        case FORCED:
                                break;
                        default:
-                               throw new IOException("Could not rewind to upstream commit");
+                               throw new IOException(
+                                               JGitText.get().couldNotRewindToUpstreamCommit);
                        }
                } finally {
                        walk.close();
@@ -1468,7 +1471,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
        public RebaseCommand setUpstreamName(String upstreamName) {
                if (upstreamCommit == null) {
                        throw new IllegalStateException(
-                                       "setUpstreamName must be called after setUpstream.");
+                                       "setUpstreamName must be called after setUpstream."); //$NON-NLS-1$
                }
                this.upstreamCommitName = upstreamName;
                return this;
index 6183da033bc5f41be1795234c4406a92a80f732d..c2e42e2a1ef03685dc0b53155ccbd05a011b1f85 100644 (file)
@@ -157,8 +157,8 @@ public class ResetCommand extends GitCommand<Ref> {
                        if (ref != null && commitId == null) {
                                // @TODO throw an InvalidRefNameException. We can't do that
                                // now because this would break the API
-                               throw new JGitInternalException("Invalid ref " + ref
-                                               + " specified");
+                               throw new JGitInternalException(MessageFormat
+                                               .format(JGitText.get().invalidRefName, ref));
                        }
 
                        final ObjectId commitTree;
index 3077e18c159394bb23b5d4f0b2c9df3ebdd89bb6..b53c7c95f02af83e35c80d80cb1c41d5c2f1e64b 100644 (file)
@@ -86,6 +86,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String badEscape;
        /***/ public String badGroupHeader;
        /***/ public String badObjectType;
+       /***/ public String badRef;
        /***/ public String badSectionEntry;
        /***/ public String bareRepositoryNoWorkdirAndIndex;
        /***/ public String base64InputNotProperlyPadded;
@@ -117,16 +118,23 @@ public class JGitText extends TranslationBundle {
        /***/ public String cannotCreateTempDir;
        /***/ public String cannotDeleteCheckedOutBranch;
        /***/ public String cannotDeleteFile;
+       /***/ public String cannotDeleteObjectsPath;
        /***/ public String cannotDeleteStaleTrackingRef;
        /***/ public String cannotDeleteStaleTrackingRef2;
        /***/ public String cannotDetermineProxyFor;
        /***/ public String cannotDownload;
+       /***/ public String cannotEnterObjectsPath;
+       /***/ public String cannotEnterPathFromParent;
        /***/ public String cannotExecute;
        /***/ public String cannotGet;
+       /***/ public String cannotGetObjectsPath;
+       /***/ public String cannotListObjectsPath;
+       /***/ public String cannotListPackPath;
        /***/ public String cannotListRefs;
        /***/ public String cannotLock;
        /***/ public String cannotLockPackIn;
        /***/ public String cannotMatchOnEmptyString;
+       /***/ public String cannotMkdirObjectPath;
        /***/ public String cannotMoveIndexTo;
        /***/ public String cannotMovePackTo;
        /***/ public String cannotOpenService;
@@ -139,13 +147,16 @@ public class JGitText extends TranslationBundle {
        /***/ public String cannotReadFile;
        /***/ public String cannotReadHEAD;
        /***/ public String cannotReadObject;
+       /***/ public String cannotReadObjectsPath;
        /***/ public String cannotReadTree;
        /***/ public String cannotRebaseWithoutCurrentHead;
        /***/ public String cannotResolveLocalTrackingRefForUpdating;
        /***/ public String cannotSquashFixupWithoutPreviousCommit;
        /***/ public String cannotStoreObjects;
+       /***/ public String cannotResolveUniquelyAbbrevObjectId;
        /***/ public String cannotUnloadAModifiedTree;
        /***/ public String cannotWorkWithOtherStagesThanZeroRightNow;
+       /***/ public String cannotWriteObjectsPath;
        /***/ public String canOnlyCherryPickCommitsWithOneParent;
        /***/ public String canOnlyRevertCommitsWithOneParent;
        /***/ public String commitDoesNotHaveGivenParent;
@@ -172,26 +183,60 @@ public class JGitText extends TranslationBundle {
        /***/ public String corruptionDetectedReReadingAt;
        /***/ public String corruptObjectBadStream;
        /***/ public String corruptObjectBadStreamCorruptHeader;
+       /***/ public String corruptObjectDuplicateEntryNames;
        /***/ public String corruptObjectGarbageAfterSize;
        /***/ public String corruptObjectIncorrectLength;
+       /***/ public String corruptObjectIncorrectSorting;
+       /***/ public String corruptObjectInvalidAuthor;
+       /***/ public String corruptObjectInvalidCommitter;
        /***/ public String corruptObjectInvalidEntryMode;
        /***/ public String corruptObjectInvalidMode;
+       /***/ public String corruptObjectInvalidModeChar;
+       /***/ public String corruptObjectInvalidModeStartsZero;
        /***/ public String corruptObjectInvalidMode2;
        /***/ public String corruptObjectInvalidMode3;
+       /***/ public String corruptObjectInvalidName;
+       /***/ public String corruptObjectInvalidNameAux;
+       /***/ public String corruptObjectInvalidNameCon;
+       /***/ public String corruptObjectInvalidNameCom;
+       /***/ public String corruptObjectInvalidNameEnd;
+       /***/ public String corruptObjectInvalidNameIgnorableUnicode;
+       /***/ public String corruptObjectInvalidNameInvalidUtf8;
+       /***/ public String corruptObjectInvalidNameLpt;
+       /***/ public String corruptObjectInvalidNameNul;
+       /***/ public String corruptObjectInvalidNamePrn;
+       /***/ public String corruptObjectInvalidObject;
+       /***/ public String corruptObjectInvalidParent;
+       /***/ public String corruptObjectInvalidTagger;
+       /***/ public String corruptObjectInvalidTree;
        /***/ public String corruptObjectInvalidType;
        /***/ public String corruptObjectInvalidType2;
        /***/ public String corruptObjectMalformedHeader;
+       /***/ public String corruptObjectNameContainsByte;
+       /***/ public String corruptObjectNameContainsChar;
+       /***/ public String corruptObjectNameContainsNullByte;
+       /***/ public String corruptObjectNameContainsSlash;
+       /***/ public String corruptObjectNameDot;
+       /***/ public String corruptObjectNameDotDot;
+       /***/ public String corruptObjectNameZeroLength;
        /***/ public String corruptObjectNegativeSize;
        /***/ public String corruptObjectNoAuthor;
        /***/ public String corruptObjectNoCommitter;
        /***/ public String corruptObjectNoHeader;
        /***/ public String corruptObjectNoObject;
+       /***/ public String corruptObjectNoObjectHeader;
        /***/ public String corruptObjectNoTaggerBadHeader;
        /***/ public String corruptObjectNoTaggerHeader;
+       /***/ public String corruptObjectNoTagHeader;
        /***/ public String corruptObjectNoTagName;
        /***/ public String corruptObjectNotree;
+       /***/ public String corruptObjectNotreeHeader;
        /***/ public String corruptObjectNoType;
+       /***/ public String corruptObjectNoTypeHeader;
        /***/ public String corruptObjectPackfileChecksumIncorrect;
+       /***/ public String corruptObjectTruncatedInMode;
+       /***/ public String corruptObjectTruncatedInName;
+       /***/ public String corruptObjectTruncatedInObjectId;
        /***/ public String corruptPack;
        /***/ public String couldNotCheckOutBecauseOfConflicts;
        /***/ public String couldNotDeleteLockFileShouldNotHappen;
@@ -204,6 +249,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String couldNotRenameDeleteOldIndex;
        /***/ public String couldNotRenameTemporaryFile;
        /***/ public String couldNotRenameTemporaryIndexFileToIndex;
+       /***/ public String couldNotRewindToUpstreamCommit;
        /***/ public String couldNotURLEncodeToUTF8;
        /***/ public String couldNotWriteFile;
        /***/ public String countingObjects;
@@ -239,6 +285,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String eitherGitDirOrWorkTreeRequired;
        /***/ public String emptyCommit;
        /***/ public String emptyPathNotPermitted;
+       /***/ public String emptyRef;
        /***/ public String encryptionError;
        /***/ public String endOfFileInEscape;
        /***/ public String entryNotFoundByPath;
@@ -299,6 +346,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String gcFailed;
        /***/ public String gitmodulesNotFound;
        /***/ public String headRequiredToStash;
+       /***/ public String hiddenFilesStartWithDot;
        /***/ public String hoursAgo;
        /***/ public String hugeIndexesAreNotSupportedByJgitYet;
        /***/ public String hunkBelongsToAnotherFile;
@@ -337,6 +385,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String invalidGitType;
        /***/ public String invalidId;
        /***/ public String invalidIdLength;
+       /***/ public String invalidIgnoreParamSubmodule;
        /***/ public String invalidIntegerValue;
        /***/ public String invalidKey;
        /***/ public String invalidLineInConfigFile;
@@ -369,8 +418,10 @@ public class JGitText extends TranslationBundle {
        /***/ public String largeObjectOutOfMemory;
        /***/ public String lengthExceedsMaximumArraySize;
        /***/ public String listingAlternates;
+       /***/ public String listingPacks;
        /***/ public String localObjectsIncomplete;
        /***/ public String localRefIsMissingObjects;
+       /***/ public String localRepository;
        /***/ public String lockCountMustBeGreaterOrEqual1;
        /***/ public String lockError;
        /***/ public String lockOnNotClosed;
@@ -469,6 +520,8 @@ public class JGitText extends TranslationBundle {
        /***/ public String pathNotConfigured;
        /***/ public String peeledLineBeforeRef;
        /***/ public String peerDidNotSupplyACompleteObjectGraph;
+       /***/ public String personIdentEmailNonNull;
+       /***/ public String personIdentNameNonNull;
        /***/ public String prefixRemote;
        /***/ public String problemWithResolvingPushRefSpecsLocally;
        /***/ public String progressMonUploading;
@@ -512,6 +565,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String repositoryIsRequired;
        /***/ public String repositoryNotFound;
        /***/ public String repositoryState_applyMailbox;
+       /***/ public String repositoryState_bare;
        /***/ public String repositoryState_bisecting;
        /***/ public String repositoryState_conflicts;
        /***/ public String repositoryState_merged;
@@ -525,6 +579,9 @@ public class JGitText extends TranslationBundle {
        /***/ public String resolvingDeltas;
        /***/ public String resultLengthIncorrect;
        /***/ public String rewinding;
+       /***/ public String s3ActionDeletion;
+       /***/ public String s3ActionReading;
+       /***/ public String s3ActionWriting;
        /***/ public String searchForReuse;
        /***/ public String searchForSizes;
        /***/ public String secondsAgo;
@@ -606,6 +663,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String unencodeableFile;
        /***/ public String unexpectedCompareResult;
        /***/ public String unexpectedEndOfConfigFile;
+       /***/ public String unexpectedEndOfInput;
        /***/ public String unexpectedHunkTrailer;
        /***/ public String unexpectedOddResult;
        /***/ public String unexpectedRefReport;
@@ -617,6 +675,7 @@ public class JGitText extends TranslationBundle {
        /***/ public String unknownIndexVersionOrCorruptIndex;
        /***/ public String unknownObject;
        /***/ public String unknownObjectType;
+       /***/ public String unknownObjectType2;
        /***/ public String unknownRepositoryFormat;
        /***/ public String unknownRepositoryFormat2;
        /***/ public String unknownZlibError;
@@ -625,16 +684,21 @@ public class JGitText extends TranslationBundle {
        /***/ public String unpackException;
        /***/ public String unreadablePackIndex;
        /***/ public String unrecognizedRef;
+       /***/ public String unsetMark;
+       /***/ public String unsupportedAlternates;
        /***/ public String unsupportedArchiveFormat;
        /***/ public String unsupportedCommand0;
        /***/ public String unsupportedEncryptionAlgorithm;
        /***/ public String unsupportedEncryptionVersion;
        /***/ public String unsupportedGC;
+       /***/ public String unsupportedMark;
        /***/ public String unsupportedOperationNotAddAtEnd;
        /***/ public String unsupportedPackIndexVersion;
        /***/ public String unsupportedPackVersion;
+       /***/ public String updatingHeadFailed;
        /***/ public String updatingReferences;
        /***/ public String updatingRefFailed;
+       /***/ public String upstreamBranchName;
        /***/ public String uriNotConfigured;
        /***/ public String uriNotFound;
        /***/ public String URINotSupported;
index a7ab0bb4a372c59dc5750c707f42ef0eee3c6ac4..1665c2c772b781c2eaba0451133788944d789146 100644 (file)
@@ -61,6 +61,7 @@ import java.util.zip.Inflater;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.internal.storage.file.BitmapIndexImpl;
 import org.eclipse.jgit.internal.storage.file.PackBitmapIndex;
 import org.eclipse.jgit.internal.storage.file.PackIndex;
@@ -210,7 +211,8 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
                }
 
                if (typeHint == OBJ_ANY)
-                       throw new MissingObjectException(objectId.copy(), "unknown");
+                       throw new MissingObjectException(objectId.copy(),
+                                       JGitText.get().unknownObjectType2);
                throw new MissingObjectException(objectId.copy(), typeHint);
        }
 
@@ -339,7 +341,8 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
 
                        public ObjectLoader open() throws IOException {
                                if (cur.pack == null)
-                                       throw new MissingObjectException(cur.id, "unknown");
+                                       throw new MissingObjectException(cur.id,
+                                                       JGitText.get().unknownObjectType2);
                                return cur.pack.load(DfsReader.this, cur.offset);
                        }
 
@@ -376,7 +379,8 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
                                if (idItr.hasNext()) {
                                        cur = idItr.next();
                                        if (cur.pack == null)
-                                               throw new MissingObjectException(cur.id, "unknown");
+                                               throw new MissingObjectException(cur.id,
+                                                               JGitText.get().unknownObjectType2);
                                        sz = cur.pack.getObjectSize(DfsReader.this, cur.offset);
                                        return true;
                                } else if (findAllError != null) {
@@ -429,7 +433,8 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs {
                }
 
                if (typeHint == OBJ_ANY)
-                       throw new MissingObjectException(objectId.copy(), "unknown");
+                       throw new MissingObjectException(objectId.copy(),
+                                       JGitText.get().unknownObjectType2);
                throw new MissingObjectException(objectId.copy(), typeHint);
        }
 
index e0c0d0a5bf7a473fff0c202bc52bd43e7f8d0b33..77e060a564f82b6bcd18c034d9f297fe133d5a59 100644 (file)
@@ -46,6 +46,7 @@ package org.eclipse.jgit.internal.storage.dfs;
 import java.io.File;
 import java.io.IOException;
 
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.lib.BaseRepositoryBuilder;
 
 /**
@@ -141,7 +142,8 @@ public abstract class DfsRepositoryBuilder<B extends DfsRepositoryBuilder, R ext
 
        @Override
        public B addAlternateObjectDirectory(File other) {
-               throw new UnsupportedOperationException("Alternates not supported");
+               throw new UnsupportedOperationException(
+                               JGitText.get().unsupportedAlternates);
        }
 
        @Override
index 21d6cd2ca58697d4bd3630b5554d7c0bae90bef1..3e6cb583584c9ea1cbf63350c15502e9c01b4e1a 100644 (file)
@@ -56,6 +56,7 @@ import java.util.zip.Inflater;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.internal.storage.pack.CachedPack;
 import org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs;
 import org.eclipse.jgit.internal.storage.pack.ObjectToPack;
@@ -141,7 +142,8 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs {
                final ObjectLoader ldr = db.openObject(this, objectId);
                if (ldr == null) {
                        if (typeHint == OBJ_ANY)
-                               throw new MissingObjectException(objectId.copy(), "unknown");
+                               throw new MissingObjectException(objectId.copy(),
+                                               JGitText.get().unknownObjectType2);
                        throw new MissingObjectException(objectId.copy(), typeHint);
                }
                if (typeHint != OBJ_ANY && ldr.getType() != typeHint)
@@ -160,7 +162,8 @@ final class WindowCursor extends ObjectReader implements ObjectReuseAsIs {
                long sz = db.getObjectSize(this, objectId);
                if (sz < 0) {
                        if (typeHint == OBJ_ANY)
-                               throw new MissingObjectException(objectId.copy(), "unknown");
+                               throw new MissingObjectException(objectId.copy(),
+                                               JGitText.get().unknownObjectType2);
                        throw new MissingObjectException(objectId.copy(), typeHint);
                }
                return sz;
index a3961118336a4ff13602b04ff6082c788cea7e09..3fde2f919bea2d814e2990827dc25c730824bac5 100644 (file)
@@ -48,6 +48,7 @@
 package org.eclipse.jgit.lib;
 
 import java.io.IOException;
+import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -63,6 +64,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.errors.StopWalkException;
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.revwalk.RevTree;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.submodule.SubmoduleWalk;
@@ -529,9 +531,9 @@ public class IndexDiff {
                                                        .equals(localIgnoreSubmoduleMode))
                                                continue;
                                } catch (ConfigInvalidException e) {
-                                       IOException e1 = new IOException(
-                                                       "Found invalid ignore param for submodule "
-                                                                       + smw.getPath());
+                                       IOException e1 = new IOException(MessageFormat.format(
+                                                       JGitText.get().invalidIgnoreParamSubmodule,
+                                                       smw.getPath()));
                                        e1.initCause(e);
                                        throw e1;
                                }
index 359b592952f0017d5cf3d09abe301546c7bd7332..33c65ab044b3b41e3257b618381749b1a62ef289 100644 (file)
@@ -254,25 +254,32 @@ public class ObjectChecker {
                int ptr = 0;
 
                if ((ptr = match(raw, ptr, tree)) < 0)
-                       throw new CorruptObjectException("no tree header");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNotreeHeader);
                if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                       throw new CorruptObjectException("invalid tree");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectInvalidTree);
 
                while (match(raw, ptr, parent) >= 0) {
                        ptr += parent.length;
                        if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                               throw new CorruptObjectException("invalid parent");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidParent);
                }
 
                if ((ptr = match(raw, ptr, author)) < 0)
-                       throw new CorruptObjectException("no author");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNoAuthor);
                if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                       throw new CorruptObjectException("invalid author");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectInvalidAuthor);
 
                if ((ptr = match(raw, ptr, committer)) < 0)
-                       throw new CorruptObjectException("no committer");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNoCommitter);
                if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                       throw new CorruptObjectException("invalid committer");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectInvalidCommitter);
        }
 
        /**
@@ -287,21 +294,26 @@ public class ObjectChecker {
                int ptr = 0;
 
                if ((ptr = match(raw, ptr, object)) < 0)
-                       throw new CorruptObjectException("no object header");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNoObjectHeader);
                if ((ptr = id(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                       throw new CorruptObjectException("invalid object");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectInvalidObject);
 
                if ((ptr = match(raw, ptr, type)) < 0)
-                       throw new CorruptObjectException("no type header");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNoTypeHeader);
                ptr = nextLF(raw, ptr);
 
                if ((ptr = match(raw, ptr, tag)) < 0)
-                       throw new CorruptObjectException("no tag header");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNoTagHeader);
                ptr = nextLF(raw, ptr);
 
                if ((ptr = match(raw, ptr, tagger)) > 0) {
                        if ((ptr = personIdent(raw, ptr)) < 0 || raw[ptr++] != '\n')
-                               throw new CorruptObjectException("invalid tagger");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidTagger);
                }
        }
 
@@ -382,37 +394,46 @@ public class ObjectChecker {
                        int thisMode = 0;
                        for (;;) {
                                if (ptr == sz)
-                                       throw new CorruptObjectException("truncated in mode");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectTruncatedInMode);
                                final byte c = raw[ptr++];
                                if (' ' == c)
                                        break;
                                if (c < '0' || c > '7')
-                                       throw new CorruptObjectException("invalid mode character");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectInvalidModeChar);
                                if (thisMode == 0 && c == '0' && !allowZeroMode)
-                                       throw new CorruptObjectException("mode starts with '0'");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectInvalidModeStartsZero);
                                thisMode <<= 3;
                                thisMode += c - '0';
                        }
 
                        if (FileMode.fromBits(thisMode).getObjectType() == Constants.OBJ_BAD)
-                               throw new CorruptObjectException("invalid mode " + thisMode);
+                               throw new CorruptObjectException(MessageFormat.format(
+                                               JGitText.get().corruptObjectInvalidMode2,
+                                               Integer.valueOf(thisMode)));
 
                        final int thisNameB = ptr;
                        ptr = scanPathSegment(raw, ptr, sz);
                        if (ptr == sz || raw[ptr] != 0)
-                               throw new CorruptObjectException("truncated in name");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectTruncatedInName);
                        checkPathSegment2(raw, thisNameB, ptr);
                        if (normalized != null) {
                                if (!normalized.add(normalize(raw, thisNameB, ptr)))
-                                       throw new CorruptObjectException("duplicate entry names");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectDuplicateEntryNames);
                        } else if (duplicateName(raw, thisNameB, ptr))
-                               throw new CorruptObjectException("duplicate entry names");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectDuplicateEntryNames);
 
                        if (lastNameB != 0) {
                                final int cmp = pathCompare(raw, lastNameB, lastNameE,
                                                lastMode, thisNameB, ptr, thisMode);
                                if (cmp > 0)
-                                       throw new CorruptObjectException("incorrectly sorted");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectIncorrectSorting);
                        }
 
                        lastNameB = thisNameB;
@@ -421,7 +442,8 @@ public class ObjectChecker {
 
                        ptr += 1 + Constants.OBJECT_ID_LENGTH;
                        if (ptr > sz)
-                               throw new CorruptObjectException("truncated in object id");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectTruncatedInObjectId);
                }
        }
 
@@ -432,13 +454,16 @@ public class ObjectChecker {
                        if (c == 0)
                                return ptr;
                        if (c == '/')
-                               throw new CorruptObjectException("name contains '/'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectNameContainsSlash);
                        if (windows && isInvalidOnWindows(c)) {
                                if (c > 31)
                                        throw new CorruptObjectException(String.format(
-                                                       "name contains '%c'", c));
+                                                       JGitText.get().corruptObjectNameContainsChar,
+                                                       Byte.valueOf(c)));
                                throw new CorruptObjectException(String.format(
-                                               "name contains byte 0x%x", c & 0xff));
+                                               JGitText.get().corruptObjectNameContainsByte,
+                                               Integer.valueOf(c & 0xff)));
                        }
                }
                return ptr;
@@ -496,49 +521,55 @@ public class ObjectChecker {
                        throws CorruptObjectException {
                int e = scanPathSegment(raw, ptr, end);
                if (e < end && raw[e] == 0)
-                       throw new CorruptObjectException("name contains byte 0x00");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNameContainsNullByte);
                checkPathSegment2(raw, ptr, end);
        }
 
        private void checkPathSegment2(byte[] raw, int ptr, int end)
                        throws CorruptObjectException {
                if (ptr == end)
-                       throw new CorruptObjectException("zero length name");
+                       throw new CorruptObjectException(
+                                       JGitText.get().corruptObjectNameZeroLength);
                if (raw[ptr] == '.') {
                        switch (end - ptr) {
                        case 1:
-                               throw new CorruptObjectException("invalid name '.'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectNameDot);
                        case 2:
                                if (raw[ptr + 1] == '.')
-                                       throw new CorruptObjectException("invalid name '..'");
+                                       throw new CorruptObjectException(
+                                                       JGitText.get().corruptObjectNameDotDot);
                                break;
                        case 4:
                                if (isGit(raw, ptr + 1))
                                        throw new CorruptObjectException(String.format(
-                                                       "invalid name '%s'",
+                                                       JGitText.get().corruptObjectInvalidName,
                                                        RawParseUtils.decode(raw, ptr, end)));
                                break;
                        default:
                                if (end - ptr > 4 && isNormalizedGit(raw, ptr + 1, end))
                                        throw new CorruptObjectException(String.format(
-                                                       "invalid name '%s'",
+                                                       JGitText.get().corruptObjectInvalidName,
                                                        RawParseUtils.decode(raw, ptr, end)));
                        }
                } else if (isGitTilde1(raw, ptr, end)) {
-                       throw new CorruptObjectException(String.format("invalid name '%s'",
+                       throw new CorruptObjectException(String.format(
+                                       JGitText.get().corruptObjectInvalidName,
                                        RawParseUtils.decode(raw, ptr, end)));
                }
 
                if (macosx && isMacHFSGit(raw, ptr, end))
                        throw new CorruptObjectException(String.format(
-                                       "invalid name '%s' contains ignorable Unicode characters",
+                                       JGitText.get().corruptObjectInvalidNameIgnorableUnicode,
                                        RawParseUtils.decode(raw, ptr, end)));
 
                if (windows) {
                        // Windows ignores space and dot at end of file name.
                        if (raw[end - 1] == ' ' || raw[end - 1] == '.')
-                               throw new CorruptObjectException("invalid name ends with '"
-                                               + ((char) raw[end - 1]) + "'");
+                               throw new CorruptObjectException(String.format(
+                                               JGitText.get().corruptObjectInvalidNameEnd,
+                                               Character.valueOf(((char) raw[end - 1]))));
                        if (end - ptr >= 3)
                                checkNotWindowsDevice(raw, ptr, end);
                }
@@ -615,7 +646,7 @@ public class ObjectChecker {
                        throws CorruptObjectException {
                if ((ptr + 2) >= end)
                        throw new CorruptObjectException(MessageFormat.format(
-                               "invalid name contains byte sequence ''{0}'' which is not a valid UTF-8 character",
+                                       JGitText.get().corruptObjectInvalidNameInvalidUtf8,
                                        toHexString(raw, ptr, end)));
        }
 
@@ -634,7 +665,8 @@ public class ObjectChecker {
                                        && toLower(raw[ptr + 1]) == 'u'
                                        && toLower(raw[ptr + 2]) == 'x'
                                        && (end - ptr == 3 || raw[ptr + 3] == '.'))
-                               throw new CorruptObjectException("invalid name 'AUX'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidNameAux);
                        break;
 
                case 'c': // CON, COM[1-9]
@@ -642,14 +674,16 @@ public class ObjectChecker {
                                        && toLower(raw[ptr + 2]) == 'n'
                                        && toLower(raw[ptr + 1]) == 'o'
                                        && (end - ptr == 3 || raw[ptr + 3] == '.'))
-                               throw new CorruptObjectException("invalid name 'CON'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidNameCon);
                        if (end - ptr >= 4
                                        && toLower(raw[ptr + 2]) == 'm'
                                        && toLower(raw[ptr + 1]) == 'o'
                                        && isPositiveDigit(raw[ptr + 3])
                                        && (end - ptr == 4 || raw[ptr + 4] == '.'))
-                               throw new CorruptObjectException("invalid name 'COM"
-                                               + ((char) raw[ptr + 3]) + "'");
+                               throw new CorruptObjectException(String.format(
+                                               JGitText.get().corruptObjectInvalidNameCom,
+                                               Character.valueOf(((char) raw[ptr + 3]))));
                        break;
 
                case 'l': // LPT[1-9]
@@ -658,8 +692,9 @@ public class ObjectChecker {
                                        && toLower(raw[ptr + 2]) == 't'
                                        && isPositiveDigit(raw[ptr + 3])
                                        && (end - ptr == 4 || raw[ptr + 4] == '.'))
-                               throw new CorruptObjectException("invalid name 'LPT"
-                                               + ((char) raw[ptr + 3]) + "'");
+                               throw new CorruptObjectException(String.format(
+                                               JGitText.get().corruptObjectInvalidNameLpt,
+                                               Character.valueOf(((char) raw[ptr + 3]))));
                        break;
 
                case 'n': // NUL
@@ -667,7 +702,8 @@ public class ObjectChecker {
                                        && toLower(raw[ptr + 1]) == 'u'
                                        && toLower(raw[ptr + 2]) == 'l'
                                        && (end - ptr == 3 || raw[ptr + 3] == '.'))
-                               throw new CorruptObjectException("invalid name 'NUL'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidNameNul);
                        break;
 
                case 'p': // PRN
@@ -675,7 +711,8 @@ public class ObjectChecker {
                                        && toLower(raw[ptr + 1]) == 'r'
                                        && toLower(raw[ptr + 2]) == 'n'
                                        && (end - ptr == 3 || raw[ptr + 3] == '.'))
-                               throw new CorruptObjectException("invalid name 'PRN'");
+                               throw new CorruptObjectException(
+                                               JGitText.get().corruptObjectInvalidNamePrn);
                        break;
                }
        }
index 2f04751a1d411b31825f8b40aa348d1ff454ee53..bdbffee490d96ef9b74d967f5211c1b98ed93ca3 100644 (file)
@@ -45,6 +45,7 @@
 package org.eclipse.jgit.lib;
 
 import org.eclipse.jgit.errors.InvalidObjectIdException;
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.util.NB;
 import org.eclipse.jgit.util.RawParseUtils;
 
@@ -52,6 +53,7 @@ import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.text.MessageFormat;
 
 /**
  * A SHA-1 abstraction.
@@ -229,7 +231,8 @@ public class ObjectId extends AnyObjectId implements Serializable {
         */
        public static ObjectId fromString(final String str) {
                if (str.length() != Constants.OBJECT_ID_STRING_LENGTH)
-                       throw new IllegalArgumentException("Invalid id: " + str);
+                       throw new IllegalArgumentException(
+                                       MessageFormat.format(JGitText.get().invalidId, str));
                return fromHexString(Constants.encodeASCII(str), 0);
        }
 
index 5d892019ab2c48050bd708402c1735e28fd759bb..d9da65f03fe79de80bd8f80489567fa6f48030e1 100644 (file)
@@ -52,6 +52,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.security.MessageDigest;
 
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.transport.PackParser;
 
 /**
@@ -263,7 +264,7 @@ public abstract class ObjectInserter implements AutoCloseable {
                while (length > 0) {
                        int n = in.read(buf, 0, (int) Math.min(length, buf.length));
                        if (n < 0)
-                               throw new EOFException("Unexpected end of input");
+                               throw new EOFException(JGitText.get().unexpectedEndOfInput);
                        md.update(buf, 0, n);
                        length -= n;
                }
index 8f7e3eff7c67279063f304f2b74ede36ebe01e49..e8591195cfab5140b57a06d19dda6eecac16fe4e 100644 (file)
@@ -51,6 +51,7 @@ import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
 
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.util.SystemReader;
 
 /**
@@ -181,10 +182,10 @@ public class PersonIdent implements Serializable {
                        final long aWhen, final int aTZ) {
                if (aName == null)
                        throw new IllegalArgumentException(
-                                       "Name of PersonIdent must not be null.");
+                                       JGitText.get().personIdentNameNonNull);
                if (aEmailAddress == null)
                        throw new IllegalArgumentException(
-                                       "E-mail address of PersonIdent must not be null.");
+                                       JGitText.get().personIdentEmailNonNull);
                name = aName;
                emailAddress = aEmailAddress;
                when = aWhen;
index 4fac2ebed5224a5189881af85294bd39d4ff7b9c..9b7234b3aff8ae81d4b09b2475ddb1844bb2307f 100644 (file)
@@ -73,7 +73,9 @@ public enum RepositoryState {
                public boolean isRebasing() { return false; }
 
                @Override
-               public String getDescription() { return "Bare"; }
+               public String getDescription() {
+                       return JGitText.get().repositoryState_bare;
+               }
        },
 
        /**
index f43ea637aaaab3b619977896787785a81349f049..d3cdba5bf398cb26cb0dcb69a479045c06afe820 100644 (file)
@@ -292,10 +292,10 @@ public class AmazonS3 {
                        case HttpURLConnection.HTTP_INTERNAL_ERROR:
                                continue;
                        default:
-                               throw error("Reading", key, c);
+                               throw error(JGitText.get().s3ActionReading, key, c);
                        }
                }
-               throw maxAttempts("Reading", key);
+               throw maxAttempts(JGitText.get().s3ActionReading, key);
        }
 
        /**
@@ -365,10 +365,10 @@ public class AmazonS3 {
                        case HttpURLConnection.HTTP_INTERNAL_ERROR:
                                continue;
                        default:
-                               throw error("Deletion", key, c);
+                               throw error(JGitText.get().s3ActionDeletion, key, c);
                        }
                }
-               throw maxAttempts("Deletion", key);
+               throw maxAttempts(JGitText.get().s3ActionDeletion, key);
        }
 
        /**
@@ -426,10 +426,10 @@ public class AmazonS3 {
                        case HttpURLConnection.HTTP_INTERNAL_ERROR:
                                continue;
                        default:
-                               throw error("Writing", key, c);
+                               throw error(JGitText.get().s3ActionWriting, key, c);
                        }
                }
-               throw maxAttempts("Writing", key);
+               throw maxAttempts(JGitText.get().s3ActionWriting, key);
        }
 
        /**
@@ -512,10 +512,10 @@ public class AmazonS3 {
                        case HttpURLConnection.HTTP_INTERNAL_ERROR:
                                continue;
                        default:
-                               throw error("Writing", key, c);
+                               throw error(JGitText.get().s3ActionWriting, key, c);
                        }
                }
-               throw maxAttempts("Writing", key);
+               throw maxAttempts(JGitText.get().s3ActionWriting, key);
        }
 
        private IOException error(final String action, final String key,
index e5d59b579b9e05b63eeb844db2633e7f6addb0b7..b4a09020b532c8d7781c6d16dbabbc8c79755037 100644 (file)
@@ -55,6 +55,7 @@ import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
 
 import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.util.io.StreamCopyThread;
 
 import com.jcraft.jsch.Channel;
@@ -76,7 +77,7 @@ public class JschSession implements RemoteSession {
        /**
         * Create a new session object by passing the real Jsch session and the URI
         * information.
-        * 
+        *
         * @param session
         *            the real Jsch session created elsewhere.
         * @param uri
@@ -149,7 +150,8 @@ public class JschSession implements RemoteSession {
                                setupStreams();
                                channel.connect(timeout > 0 ? timeout * 1000 : 0);
                                if (!channel.isConnected())
-                                       throw new TransportException(uri, "connection failed");
+                                       throw new TransportException(uri,
+                                                       JGitText.get().connectionFailed);
                        } catch (JSchException e) {
                                throw new TransportException(uri, e.getMessage(), e);
                        }
index 756a1619851b9ddbd1881b064fce93e231bed7c6..c47645cd73aef04031320c1956af9c4442069a20 100644 (file)
@@ -47,6 +47,7 @@ import java.io.BufferedReader;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -179,8 +180,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                close();
                                throw err;
                        } catch (SftpException je) {
-                               throw new TransportException("Can't enter " + path + "/objects"
-                                               + ": " + je.getMessage(), je); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotEnterObjectsPath, path,
+                                               je.getMessage()), je);
                        }
                }
 
@@ -195,8 +197,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                close();
                                throw err;
                        } catch (SftpException je) {
-                               throw new TransportException("Can't enter " + p + " from "
-                                               + parent.objectsPath + ": " + je.getMessage(), je); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotEnterPathFromParent, p,
+                                               parent.objectsPath, je.getMessage()), je);
                        }
                }
 
@@ -253,8 +256,10 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                        }
                                });
                        } catch (SftpException je) {
-                               throw new TransportException("Can't ls " + objectsPath
-                                               + "/pack: " + je.getMessage(), je);
+                               throw new TransportException(
+                                               MessageFormat.format(JGitText.get().cannotListPackPath,
+                                                               objectsPath, je.getMessage()),
+                                               je);
                        }
                        return packs;
                }
@@ -267,8 +272,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        } catch (SftpException je) {
                                if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)
                                        throw new FileNotFoundException(path);
-                               throw new TransportException("Can't get " + objectsPath + "/" //$NON-NLS-2$
-                                               + path + ": " + je.getMessage(), je); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotGetObjectsPath, objectsPath, path,
+                                               je.getMessage()), je);
                        }
                }
 
@@ -279,8 +285,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        } catch (SftpException je) {
                                if (je.id == ChannelSftp.SSH_FX_NO_SUCH_FILE)
                                        return;
-                               throw new TransportException("Can't delete " + objectsPath
-                                               + "/" + path + ": " + je.getMessage(), je); //$NON-NLS-1$//$NON-NLS-2$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotDeleteObjectsPath, objectsPath,
+                                               path, je.getMessage()), je);
                        }
 
                        // Prune any now empty directories.
@@ -318,8 +325,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                        }
                                }
 
-                               throw new TransportException("Can't write " + objectsPath + "/" //$NON-NLS-2$
-                                               + path + ": " + je.getMessage(), je); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotWriteObjectsPath, objectsPath,
+                                               path, je.getMessage()), je);
                        }
                }
 
@@ -331,8 +339,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                try {
                                        ftp.rename(lock, path);
                                } catch (SftpException je) {
-                                       throw new TransportException("Can't write " + objectsPath
-                                                       + "/" + path + ": " + je.getMessage(), je); //$NON-NLS-1$//$NON-NLS-2$
+                                       throw new TransportException(MessageFormat.format(
+                                                       JGitText.get().cannotWriteObjectsPath, objectsPath,
+                                                       path, je.getMessage()), je);
                                }
                        } catch (IOException err) {
                                try {
@@ -364,8 +373,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                        }
                                }
 
-                               throw new TransportException("Can't mkdir " + objectsPath + "/"
-                                               + path + ": " + je.getMessage(), je);
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotMkdirObjectPath, objectsPath, path,
+                                               je.getMessage()), je);
                        }
                }
 
@@ -385,8 +395,9 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        try {
                                list = ftp.ls(dir);
                        } catch (SftpException je) {
-                               throw new TransportException("Can't ls " + objectsPath + "/" //$NON-NLS-2$
-                                               + dir + ": " + je.getMessage(), je); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotListObjectsPath, objectsPath, dir,
+                                               je.getMessage()), je);
                        }
 
                        for (final ChannelSftp.LsEntry ent : list) {
@@ -415,12 +426,14 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                        } catch (FileNotFoundException noRef) {
                                return null;
                        } catch (IOException err) {
-                               throw new TransportException("Cannot read " + objectsPath + "/" //$NON-NLS-2$
-                                               + path + ": " + err.getMessage(), err); //$NON-NLS-1$
+                               throw new TransportException(MessageFormat.format(
+                                               JGitText.get().cannotReadObjectsPath, objectsPath, path,
+                                               err.getMessage()), err);
                        }
 
                        if (line == null)
-                               throw new TransportException("Empty ref: " + name);
+                               throw new TransportException(
+                                               MessageFormat.format(JGitText.get().emptyRef, name));
 
                        if (line.startsWith("ref: ")) { //$NON-NLS-1$
                                final String target = line.substring("ref: ".length()); //$NON-NLS-1$
@@ -441,7 +454,8 @@ public class TransportSftp extends SshTransport implements WalkTransport {
                                return r;
                        }
 
-                       throw new TransportException("Bad ref: " + name + ": " + line); //$NON-NLS-2$
+                       throw new TransportException(
+                                       MessageFormat.format(JGitText.get().badRef, name, line));
                }
 
                private Storage loose(final Ref r) {
index a71aac59c0ba8b93acbaeab8058f7c0d1a9f7dc3..dc9dee55a47d43a2d9c026598b2088873d6d97b3 100644 (file)
@@ -430,7 +430,8 @@ class WalkFetchConnection extends BaseFetchConnection {
                                final WalkRemoteObjectDatabase wrr = noPacksYet.removeFirst();
                                final Collection<String> packNameList;
                                try {
-                                       pm.beginTask("Listing packs", ProgressMonitor.UNKNOWN);
+                                       pm.beginTask(JGitText.get().listingPacks,
+                                                       ProgressMonitor.UNKNOWN);
                                        packNameList = wrr.getPackNames();
                                } catch (IOException e) {
                                        // Try another repository.
index a46dc33cdb4c8406da692a36517210bf50d03df4..fa0292e7937b62ede812e8129da52fc557eb0743 100644 (file)
@@ -671,7 +671,7 @@ public abstract class FS {
        public void setHidden(File path, boolean hidden) throws IOException {
                if (!path.getName().startsWith(".")) //$NON-NLS-1$
                        throw new IllegalArgumentException(
-                                       "Hiding only allowed for names that start with a period");
+                                       JGitText.get().hiddenFilesStartWithDot);
        }
 
        /**
index 85c817204207a6682bfda76ef8dcf9d0eb1631d1..d74532fd4a23dd4b53034bee6a1242e66b21c190 100644 (file)
@@ -48,6 +48,8 @@ import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
+import org.eclipse.jgit.internal.JGitText;
+
 /**
  * Wraps a {@link InputStream}, limiting the number of bytes which can be
  * read.
@@ -124,10 +126,10 @@ public abstract class LimitedInputStream extends FilterInputStream {
        @Override
        public synchronized void reset() throws IOException {
                if (!in.markSupported())
-                       throw new IOException("Mark not supported");
+                       throw new IOException(JGitText.get().unsupportedMark);
 
                if (mark == -1)
-                       throw new IOException("Mark not set");
+                       throw new IOException(JGitText.get().unsetMark);
 
                in.reset();
                left = mark;