import java.util.logging.Level;
import java.util.logging.Logger;
+import javajs.J2SRequireImport;
+
/**
*
* @author David Roldan Martinez
*
*
*/
+@J2SRequireImport ({java.text.MessageFormat.class})
public class MessageManager
{
/* Getting messages for GV */
log.info("Getting messages for lang: " + loc);
rb = ResourceBundle.getBundle("lang.Messages", loc);
- if (log.isLoggable(Level.FINEST))
+ // BH rb == null just throws the exception
+ if (rb == null || log.isLoggable(Level.FINEST))
{
// this might take a while, so we only do it if it will be shown
log.finest("Language keys: " + rb.keySet());
public static String formatMessage(String key, Object... params)
{
- return MessageFormat.format(rb.getString(key), params);
+ return MessageFormat.format(getString(key), params); // BH not rb.getString
}
public static String formatMessage(String key, String[] params)
{
- return MessageFormat.format(rb.getString(key), (Object[]) params);
+ return MessageFormat.format(getString(key), (Object[]) params); // BH not rb.getString
}
/**