diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-08-18 15:58:43 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2016-08-20 11:24:45 +0900 |
commit | 0a86b03eb413271d736ae44529811a3e162a8ee1 (patch) | |
tree | 3f5805776c409498bc5831997ce3f7c125657014 /org.eclipse.jgit.lfs | |
parent | 1bea0227e7481ae9a75f0b2824d99d7c5f53570a (diff) | |
download | jgit-0a86b03eb413271d736ae44529811a3e162a8ee1.tar.gz jgit-0a86b03eb413271d736ae44529811a3e162a8ee1.zip |
LfsRepository{NotFound,ReadOnly}: Externalize message strings
Instead of hard-coding the message strings, define them in a properties
file. This will allow them to be translated.
Change-Id: I77556881579e66b2c13d187759c7efdddfee87ae
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
4 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties index 700e2d50d0..1c1bbed0e2 100644 --- a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties +++ b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties @@ -1,4 +1,6 @@ incorrectLONG_OBJECT_ID_LENGTH=Incorrect LONG_OBJECT_ID_LENGTH. invalidLongId=Invalid id: {0} invalidLongIdLength=Invalid id length {0}; should be {1} -requiredHashFunctionNotAvailable=Required hash function {0} not available.
\ No newline at end of file +requiredHashFunctionNotAvailable=Required hash function {0} not available. +repositoryNotFound=Repository {0} not found +repositoryReadOnly=Repository {0} is read-only
\ No newline at end of file diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryNotFound.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryNotFound.java index 021a100e63..bf94f515dd 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryNotFound.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryNotFound.java @@ -43,6 +43,10 @@ package org.eclipse.jgit.lfs.errors; +import java.text.MessageFormat; + +import org.eclipse.jgit.lfs.internal.LfsText; + /** * Thrown when the repository does not exist for the user. * @@ -56,6 +60,6 @@ public class LfsRepositoryNotFound extends LfsException { * */ public LfsRepositoryNotFound(String name) { - super("repository " + name + " not found"); //$NON-NLS-1$ //$NON-NLS-2$ + super(MessageFormat.format(LfsText.get().repositoryNotFound, name)); } } diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryReadOnly.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryReadOnly.java index 9de334d703..cab7e19b72 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryReadOnly.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/LfsRepositoryReadOnly.java @@ -43,6 +43,10 @@ package org.eclipse.jgit.lfs.errors; +import java.text.MessageFormat; + +import org.eclipse.jgit.lfs.internal.LfsText; + /** * Thrown when the user has read, but not write access. Only applicable when the * operation in the request is "upload". @@ -56,6 +60,6 @@ public class LfsRepositoryReadOnly extends LfsException { * @param name */ public LfsRepositoryReadOnly(String name) { - super("repository " + name + "is read-only"); //$NON-NLS-1$ //$NON-NLS-2$ + super(MessageFormat.format(LfsText.get().repositoryReadOnly, name)); } } diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java index eaffcc9047..ae4be6a947 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java @@ -62,4 +62,6 @@ public class LfsText extends TranslationBundle { /***/ public String invalidLongId; /***/ public String invalidLongIdLength; /***/ public String requiredHashFunctionNotAvailable; + /***/ public String repositoryNotFound; + /***/ public String repositoryReadOnly; } |