private String defaultFacesMessage(String messageDescriptor, Locale locale) {
   try {
     return JsfUtils.getDefaultFacesMessageBundle(locale).getString(messageDescriptor);
   } catch (MissingResourceException e) {
     return messageDescriptor;
   }
 }
  /** {@inheritDoc} */
  public String getMessage(
      MessageContext messageContext,
      String messageDescriptor,
      Map<Class, MessagePayload> messagePayload) {
    if (!isKey(messageDescriptor)) {
      return messageDescriptor;
    }

    try {
      messageDescriptor = extractKey(messageDescriptor);

      ResourceBundle resourceBundle =
          JsfUtils.getCustomFacesMessageBundle(messageContext.getLocale());

      if (resourceBundle == null) {
        return defaultFacesMessage(messageDescriptor, messageContext.getLocale());
      }
      return resourceBundle.getString(messageDescriptor);
    } catch (MissingResourceException e) {
      return defaultFacesMessage(messageDescriptor, messageContext.getLocale());
    }
  }