private ParamSaxBuffer getMessage(String catalogueID, String key) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Getting key " + key + " from catalogue " + catalogueID);
}
try {
Bundle catalogue = defaultCatalogue;
if (catalogueID != null) {
CatalogueInfo catalogueInfo = (CatalogueInfo)catalogues.get(catalogueID);
if (catalogueInfo == null) {
if (getLogger().isWarnEnabled()) {
getLogger().warn("Catalogue not found: " + catalogueID +
", will not translate key " + key);
}
return null;
}
try {
catalogue = catalogueInfo.getCatalogue();
} catch (Exception e) {
getLogger().error("Error getting catalogue " + catalogueInfo.getName() +
" from location " + catalogueInfo.getLocation() +
" for locale " + locale +
", will not translate key " + key);
return null;
}
}
return (ParamSaxBuffer)catalogue.getObject(key);
} catch (MissingResourceException e) {
getLogger().debug("Untranslated key: '" + key + "'");
return null;
}
}