From 60c5abe7203ca59f64bcda25db6ae4203b75e29c Mon Sep 17 00:00:00 2001 From: pahimar Date: Wed, 26 Sep 2012 15:13:21 -0400 Subject: [PATCH] Switch to loading the file from URL --- .../common/core/handlers/LocalizationHandler.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ee3_common/ee3/common/core/handlers/LocalizationHandler.java b/ee3_common/ee3/common/core/handlers/LocalizationHandler.java index 81de4ba7..13eb2438 100644 --- a/ee3_common/ee3/common/core/handlers/LocalizationHandler.java +++ b/ee3_common/ee3/common/core/handlers/LocalizationHandler.java @@ -2,6 +2,7 @@ package ee3.common.core.handlers; import java.io.IOException; import java.io.InputStream; +import java.net.URL; import java.util.Iterator; import java.util.Properties; import cpw.mods.fml.common.registry.LanguageRegistry; @@ -19,10 +20,16 @@ import ee3.common.lib.Localizations; */ public class LocalizationHandler { + private static final LocalizationHandler INSTANCE = new LocalizationHandler(); + + public static LocalizationHandler instance() { + return INSTANCE; + } + /*** * Loads in all the localization files from the Localizations library class */ - public static void loadLanguages() { + public void loadLanguages() { InputStream languageStream = null; Properties languageMappings = new Properties(); Iterator keyIter = null; @@ -31,7 +38,9 @@ public class LocalizationHandler { try { // For every file specified in the Localization library class, load them into the Language Registry for (String localizationFile : Localizations.localeFiles) { - languageStream = LocalizationHandler.class.getResourceAsStream(localizationFile); + URL localizationFileURL = this.getClass().getResource(localizationFile); + + languageStream = localizationFileURL.openStream(); // If this file is a XML file, load it from XML if (LocalizationHelper.isXMLLanguageFile(localizationFile)) {