}
private Map applyLocale(Map map) {
logger.debug("IN");
ConfigSingleton config = ConfigSingleton.getInstance();
Locale portalLocale = null;
try {
portalLocale = PortletUtilities.getPortalLocale();
logger.debug("Portal locale: " + portalLocale);
} catch (Exception e) {
logger.error("Error while getting portal locale.");
portalLocale = MessageBuilder.getBrowserLocaleFromSpago();
logger.debug("Spago locale: " + portalLocale);
}
SourceBean languageSB = null;
if (portalLocale != null && portalLocale.getLanguage() != null) {
languageSB = (SourceBean) config.getFilteredSourceBeanAttribute("SPAGOBI.LANGUAGE_SUPPORTED.LANGUAGE",
"language", portalLocale.getLanguage());
}
if (languageSB != null) {
map.put(COUNTRY, (String) languageSB.getAttribute("country"));