this.portalLocale = Locale.ENGLISH;
return portalLocale;
}
private Locale getUserProfileLocale(ExoContainer container, String user) {
UserProfile userProfile = null;
OrganizationService svc = (OrganizationService) container.getComponentInstanceOfType(OrganizationService.class);
if (user != null) {
try {
beginContext(svc);
userProfile = svc.getUserProfileHandler().findUserProfileByName(user);
} catch (Exception ignored) {
log.error("IGNORED: Failed to load UserProfile for username: " + user, ignored);
} finally {
try {
endContext(svc);
} catch (Exception ignored) {
// we don't care
}
}
if (userProfile == null && log.isWarnEnabled())
log.warn("Could not load user profile for " + user);
}
String lang = userProfile == null ? null : userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE);
return (lang != null) ? LocaleContextInfo.getLocale(lang) : null;
}