/** * Gets the users preferred orientation, either from the user's session or Sakai preferences and returns it * This depends on Sakai's ResourceLoader. * * @return */ public static String getUserPreferredOrientation() { ResourceLoader rl = new ResourceLoader(); return rl.getOrientation(rl.getLocale()); }
/** * Gets the users preferred orientation, either from the user's session or Sakai preferences and returns it * This depends on Sakai's ResourceLoader. * * @return */ public static String getUserPreferredOrientation() { ResourceLoader rl = new ResourceLoader(); return rl.getOrientation(rl.getLocale()); }
protected void addLocale(PortalRenderContext rcontext, Site site, String userId) { Locale prevLocale = null; ResourceLoader rl = new ResourceLoader(); if (userId != null) { prevLocale = rl.getLocale(); } Locale locale = setSiteLanguage(site); log.debug("Locale for site {} = {}", site.getId(), locale); String localeString = locale.getLanguage(); String country = locale.getCountry(); if(country.length() > 0) localeString += "-" + country; rcontext.put("locale", localeString); rcontext.put("dir", rl.getOrientation(locale)); if (prevLocale != null && !prevLocale.equals(locale)) { // if the locale was changed, clear the date/time format which was cached in the previous locale timeService.clearLocalTimeZone(userId); } } }
protected void addLocale(PortalRenderContext rcontext, Site site, String userId) { Locale prevLocale = null; ResourceLoader rl = new ResourceLoader(); if (userId != null) { prevLocale = rl.getLocale(); } Locale locale = setSiteLanguage(site); log.debug("Locale for site {} = {}", site.getId(), locale); String localeString = locale.getLanguage(); String country = locale.getCountry(); if(country.length() > 0) localeString += "-" + country; rcontext.put("locale", localeString); rcontext.put("dir", rl.getOrientation(locale)); if (prevLocale != null && !prevLocale.equals(locale)) { // if the locale was changed, clear the date/time format which was cached in the previous locale timeService.clearLocalTimeZone(userId); } } }
context.put("dir", rl.getOrientation(locale));
context.put("dir", rl.getOrientation(locale));