// throw new Exception("Can't load user portal config");
// dang.tung - set portal language by user preference -> browser ->
// default
// ------------------------------------------------------------------------------
LocaleConfigService localeConfigService = getApplicationComponent(LocaleConfigService.class);
Locale locale = context.getLocale();
if (locale == null) {
if (log.isWarnEnabled())
log.warn("No locale set on PortalRequestContext! Falling back to 'en'.");
locale = Locale.ENGLISH;
}
String localeName = LocaleContextInfo.getLocaleAsString(locale);
LocaleConfig localeConfig = localeConfigService.getLocaleConfig(localeName);
if (localeConfig == null) {
if (log.isWarnEnabled())
log.warn("Unsupported locale set on PortalRequestContext: " + localeName + "! Falling back to 'en'.");
localeConfig = localeConfigService.getLocaleConfig(Locale.ENGLISH.getLanguage());
}
setOrientation(localeConfig.getOrientation());
// -------------------------------------------------------------------------------
context.setUIApplication(this);