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>
This commit is contained in:
parent
1bea0227e7
commit
0a86b03eb4
|
@ -1,4 +1,6 @@
|
||||||
incorrectLONG_OBJECT_ID_LENGTH=Incorrect LONG_OBJECT_ID_LENGTH.
|
incorrectLONG_OBJECT_ID_LENGTH=Incorrect LONG_OBJECT_ID_LENGTH.
|
||||||
invalidLongId=Invalid id: {0}
|
invalidLongId=Invalid id: {0}
|
||||||
invalidLongIdLength=Invalid id length {0}; should be {1}
|
invalidLongIdLength=Invalid id length {0}; should be {1}
|
||||||
requiredHashFunctionNotAvailable=Required hash function {0} not available.
|
requiredHashFunctionNotAvailable=Required hash function {0} not available.
|
||||||
|
repositoryNotFound=Repository {0} not found
|
||||||
|
repositoryReadOnly=Repository {0} is read-only
|
|
@ -43,6 +43,10 @@
|
||||||
|
|
||||||
package org.eclipse.jgit.lfs.errors;
|
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.
|
* Thrown when the repository does not exist for the user.
|
||||||
*
|
*
|
||||||
|
@ -56,6 +60,6 @@ public class LfsRepositoryNotFound extends LfsException {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public LfsRepositoryNotFound(String name) {
|
public LfsRepositoryNotFound(String name) {
|
||||||
super("repository " + name + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
|
super(MessageFormat.format(LfsText.get().repositoryNotFound, name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,10 @@
|
||||||
|
|
||||||
package org.eclipse.jgit.lfs.errors;
|
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
|
* Thrown when the user has read, but not write access. Only applicable when the
|
||||||
* operation in the request is "upload".
|
* operation in the request is "upload".
|
||||||
|
@ -56,6 +60,6 @@ public class LfsRepositoryReadOnly extends LfsException {
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public LfsRepositoryReadOnly(String name) {
|
public LfsRepositoryReadOnly(String name) {
|
||||||
super("repository " + name + "is read-only"); //$NON-NLS-1$ //$NON-NLS-2$
|
super(MessageFormat.format(LfsText.get().repositoryReadOnly, name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,4 +62,6 @@ public static LfsText get() {
|
||||||
/***/ public String invalidLongId;
|
/***/ public String invalidLongId;
|
||||||
/***/ public String invalidLongIdLength;
|
/***/ public String invalidLongIdLength;
|
||||||
/***/ public String requiredHashFunctionNotAvailable;
|
/***/ public String requiredHashFunctionNotAvailable;
|
||||||
|
/***/ public String repositoryNotFound;
|
||||||
|
/***/ public String repositoryReadOnly;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue