diff --git a/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java b/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java index d511249..5086405 100644 --- a/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java +++ b/src/main/java/org/richfaces/renderkit/html/scripts/ScheduleMessages.java @@ -36,12 +36,18 @@ public class ScheduleMessages extends ClientScript { FacesContext facesContext = FacesContext.getCurrentInstance(); Application application = facesContext.getApplication(); StringBuilder out = new StringBuilder(); - out.append("RichFaces.Schedule.prototype.messages=jQuery.extend(RichFaces.Schedule.prototype.messages,{"); +// space at the end is crucial if no locale is supported + out.append("RichFaces.Schedule.prototype.messages=jQuery.extend(RichFaces.Schedule.prototype.messages,{ "); Iterator supportedLocales = application.getSupportedLocales(); while (supportedLocales.hasNext()) { Locale locale = supportedLocales.next(); ResourceBundle applicationBundle = ResourceBundle.getBundle(application.getMessageBundle(), locale, loader); - ResourceBundle stockBundle = ResourceBundle.getBundle(BUNDLE_NAME, locale, loader); + ResourceBundle stockBundle = null; + try { + stockBundle = ResourceBundle.getBundle(BUNDLE_NAME, locale, loader); + } catch (MissingResourceException e) { + LOG.debug("No bundle " + BUNDLE_NAME + " for locale " + locale + " found."); + } String[] months = new String[]{"JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"}; String[] days = new String[]{"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"}; @@ -121,6 +127,9 @@ public class ScheduleMessages extends ClientScript { try { return applicationBundle.getString(key); } catch (MissingResourceException e) { + if (stockBundle == null) { + throw e; + } try { return stockBundle.getString(key); } catch (MissingResourceException e1) {