/** Methods delegated to default ViewHandler */ public Locale calculateLocale(FacesContext arg0) { return rb.getLocale(); }
/** Methods delegated to default ViewHandler */ public Locale calculateLocale(FacesContext arg0) { return rb.getLocale(); }
/** Methods delegated to default ViewHandler */ public Locale calculateLocale(FacesContext arg0) { return rb.getLocale(); }
public CalendarUtil(ResourceLoader rb) { Locale locale = rb.getLocale(); m_calendar = Calendar.getInstance(locale); initDates(); }
/** * Gets the users preferred locale, either from the user's session or Sakai preferences and returns it * This depends on Sakai's ResourceLoader. * * @return */ public static Locale getUserPreferredLocale() { ResourceLoader rl = new ResourceLoader(); return rl.getLocale(); }
private static Locale getUserPreferredLocale() { ResourceLoader rl = new ResourceLoader(); return rl.getLocale(); } }
public DateFormat getLocaleDateFormat() { DateFormat returned = DateFormat.getDateInstance(DateFormat.SHORT, loader.getLocale()); String testDateString = returned.format(testDate); if (acceptableFormats.containsKey(testDateString)) { return acceptableFormats.get(testDateString); } else { return getDefaultDateFormat(); } }
public NumberFormat getNumberFormat(Integer maxFractionDigits, Integer minFractionDigits, Boolean groupingUsed) { NumberFormat nbFormat = NumberFormat.getInstance(); try { nbFormat = NumberFormat.getNumberInstance(new ResourceLoader().getLocale()); } catch (Exception e) { log.error("Error while retrieving local number format, using default ", e); } if (maxFractionDigits!=null) nbFormat.setMaximumFractionDigits(maxFractionDigits); if (minFractionDigits!=null) nbFormat.setMinimumFractionDigits(minFractionDigits); if (groupingUsed!=null) nbFormat.setGroupingUsed(groupingUsed); return nbFormat; }
public CalendarUtil(ResourceLoader rb) { Locale locale = rb.getLocale(); m_calendar = Calendar.getInstance(locale); initDates(); }
/** * Construct. */ public CalendarUtil() { rb = new ResourceLoader("calendar"); Locale locale = rb.getLocale(); m_calendar = Calendar.getInstance(locale); initDates(); } // CalendarUtil
public Object getObject() { String userid = sessionmanager.getCurrentSessionUserId(); Locale loc = Locale.getDefault(); if (userid != null) { ResourceLoader rl = new ResourceLoader(); loc = rl.getLocale(); } return loc; }
/** * 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()); }
/** * {@inheritDoc} */ public String getSectionDescription() { ResourceLoader loader = getLocalResourceLoader(); if (loader == null || loader.getLocale().equals(Locale.getDefault())) { return sectionDescription; } return loader.getString(getSectionDescriptionBundleKey()); }
/** * Gets the display text for the Site Override Section */ public String getSectionTitleOverride() { ResourceLoader loader = getLocalResourceLoader(); if (loader == null || loader.getLocale().equals(Locale.getDefault())) { return sectionTitleOverride; } return loader.getString(getOverrideSectionTitleBundleKey()); }
/** * @param origin origin number that is needed to validate on the default user's locale * @return true if number format is valid for user's locale */ public static boolean isValidLocaleDouble(final String origin) { return isValidLocaleDouble(origin, new ResourceLoader().getLocale()); }
/** * {@inheritDoc} */ public String getSectionTitle() { ResourceLoader loader = getLocalResourceLoader(); if (loader == null || loader.getLocale().equals(Locale.getDefault())) { return sectionTitle; } return loader.getString(getSectionTitleBundleKey()); }
/** * 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()); }
static String getLocalAMString(DateTime now) { //we need an AM date DateTime dt = now.withTimeAtStartOfDay(); Locale locale= new ResourceLoader("calendar").getLocale(); DateTimeFormatter df = new DateTimeFormatterBuilder().appendHalfdayOfDayText().toFormatter().withLocale(locale); return df.print(dt); }
static String getLocalPMString(DateTime now) { //we need an PM date DateTime dt = now.withTimeAtStartOfDay().plusHours(14); Locale locale = new ResourceLoader("calendar").getLocale(); DateTimeFormatter df = new DateTimeFormatterBuilder().appendHalfdayOfDayText().toFormatter().withLocale(locale); return df.print(dt); }
static String getLocalPMString(DateTime now) { //we need an PM date DateTime dt = now.withTimeAtStartOfDay().plusHours(14); Locale locale = new ResourceLoader("calendar").getLocale(); DateTimeFormatter df = new DateTimeFormatterBuilder().appendHalfdayOfDayText().toFormatter().withLocale(locale); return df.print(dt); }