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/src/org/eclipse/jgit | |
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/src/org/eclipse/jgit')
3 files changed, 12 insertions, 2 deletions
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; } |