LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
if (localeConfig == null)
localeConfig = localeConfigService.getDefaultLocaleConfig();
uiApp.setLocale(localeConfig.getLocale());
uiApp.setOrientation(localeConfig.getOrientation());
uiApp.localizeNavigations();
OrganizationService orgService = event.getSource().getApplicationComponent(OrganizationService.class);
String remoteUser = event.getRequestContext().getRemoteUser();
if (remoteUser != null)
{
UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);