Commit cf01a779 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fail slightly more gracefully if the resource bundle fails to load.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4143 b35dd754-fafc-0310-a699-88a17e54d16e
parent afce763b
...@@ -20,14 +20,7 @@ import java.text.Format; ...@@ -20,14 +20,7 @@ import java.text.Format;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
/** /**
...@@ -438,9 +431,15 @@ public class LocaleUtils { ...@@ -438,9 +431,15 @@ public class LocaleUtils {
} }
ClassLoader pluginClassLoader = pluginManager.getPluginClassloader(plugin).getClassLoader(); ClassLoader pluginClassLoader = pluginManager.getPluginClassloader(plugin).getClassLoader();
try {
ResourceBundle bundle = ResourceBundle.getBundle(i18nFile, locale, pluginClassLoader); ResourceBundle bundle = ResourceBundle.getBundle(i18nFile, locale, pluginClassLoader);
return getLocalizedString(key, locale, arguments, bundle); return getLocalizedString(key, locale, arguments, bundle);
} }
catch (MissingResourceException mre) {
Log.error(mre);
return key;
}
}
/** /**
* Retrieve the <code>ResourceBundle</code> that is used with this plugin. * Retrieve the <code>ResourceBundle</code> that is used with this plugin.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment