summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2014-06-15 15:58:29 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2014-06-15 15:58:29 -0400
commitbe025ff7d292baf3f5d671aefc9e17aba60dd576 (patch)
tree2b98488a2557d36c6acf60660eccb0c04e4a8c74
parent7eb0b702fdcbf82ed540c21c37e1e2b441daf09e (diff)
parent02baeab4c44d26cb0147a23e688780a862025496 (diff)
downloadjgit-be025ff7d292baf3f5d671aefc9e17aba60dd576.tar.gz
jgit-be025ff7d292baf3f5d671aefc9e17aba60dd576.zip
Merge "Enable NLS / TranslationBundle to be used in OSGi"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java
index 2c745e1f3e..c85c179aa2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/TranslationBundle.java
@@ -99,8 +99,8 @@ import org.eclipse.jgit.errors.TranslationStringMissingException;
* {@link ResourceBundle#getBundle(String, Locale)} method to load a resource
* bundle. See the documentation of this method for a detailed explanation of
* resource bundle loading strategy. After a bundle is created the
- * {@link #effectiveLocale()} method can be used to determine whether the
- * bundle really corresponds to the requested locale or is a fallback.
+ * {@link #effectiveLocale()} method can be used to determine whether the bundle
+ * really corresponds to the requested locale or is a fallback.
*
* <p>
* To load a String from a resource bundle property file this class uses the
@@ -153,13 +153,17 @@ public abstract class TranslationBundle {
*
* @param locale
* defines the locale to be used when loading the resource bundle
- * @exception TranslationBundleLoadingException see {@link TranslationBundleLoadingException}
- * @exception TranslationStringMissingException see {@link TranslationStringMissingException}
+ * @exception TranslationBundleLoadingException
+ * see {@link TranslationBundleLoadingException}
+ * @exception TranslationStringMissingException
+ * see {@link TranslationStringMissingException}
*/
- void load(Locale locale) throws TranslationBundleLoadingException {
+ void load(Locale locale)
+ throws TranslationBundleLoadingException {
Class bundleClass = getClass();
try {
- resourceBundle = ResourceBundle.getBundle(bundleClass.getName(), locale);
+ resourceBundle = ResourceBundle.getBundle(bundleClass.getName(),
+ locale, bundleClass.getClassLoader());
} catch (MissingResourceException e) {
throw new TranslationBundleLoadingException(bundleClass, locale, e);
}