public SakaiViewHandler(ViewHandler wrapped) { m_wrapped = wrapped; rb = new ResourceLoader(); }
public SakaiViewHandler(ViewHandler wrapped) { m_wrapped = wrapped; rb = new ResourceLoader(); }
public void setBasename(String baseName) { if (baseName.startsWith("classpath:")) { baseName = baseName.replaceFirst("classpath:", ""); baseName = baseName.replaceAll("/","."); } this.resourceLoader= new ResourceLoader(baseName); }
/** * 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 String getMessageFromBundle(String key) { if (toolBundle == null) toolBundle = new ResourceLoader("chat"); return toolBundle.getString(key); }
/** * Construct. */ public CalendarUtil(Calendar calendar) { rb = new ResourceLoader("calendar"); m_calendar = calendar; initDates(); } // CalendarUtil
private static Locale getUserPreferredLocale() { ResourceLoader rl = new ResourceLoader(); return rl.getLocale(); } }
/** * Construct. */ public CalendarUtil(Calendar calendar) { rb = new ResourceLoader("calendar"); m_calendar = calendar; initDates(); } // CalendarUtil
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; }
@Override public Locale getCurrentLocale() { return new ResourceLoader().getLocale(); }
/** * 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; }
@Override public String getLocalizedStatusMessage(String messageCode, String userRef) { String userId = EntityReference.getIdFromRef(userRef); ResourceLoader resourceLoader = new ResourceLoader(userId, "urkund"); return resourceLoader.getString(messageCode); }
/** * @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()); }
@Override public String getLocalizedStatusMessage(String messageCode, String userRef) { String userId = EntityReference.getIdFromRef(userRef); ResourceLoader resourceLoader = new ResourceLoader(userId, "compilatio"); return resourceLoader.getString(messageCode); }
/** * 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()); }
public String getLocalizedStatusMessage(String messageCode, String userRef) { String userId = EntityReference.getIdFromRef(userRef); ResourceLoader resourceLoader = new ResourceLoader(userId, "turnitin"); return resourceLoader.getString(messageCode); }
/** * 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); }