Package org.olat.core.gui.translator

Examples of org.olat.core.gui.translator.Translator.translate()


      errors.append("<p>").append(trans.translate("mailhelper.error.attachment")).append("</p>");
    } else {
      // mail could be send, but maybe not to all the users (e.g. invalid mail
      // adresses or a temporary problem)
      if (failedIdentites != null && failedIdentites.size() > 0) {
        warnings.append("<p>").append(trans.translate("mailhelper.error.failedusers"));
        warnings.append("<ul>");
        for (Identity identity : failedIdentites) {
          User user = identity.getUser();
          warnings.append("<li>");
          warnings.append(trans.translate("mailhelper.error.failedusers.user", new String[] { user.getProperty(UserConstants.FIRSTNAME, null), user.getProperty(UserConstants.LASTNAME, null),
View Full Code Here


        Formatter.getInstance(ureq.getLocale()).formatTime(new Date(lockEntry.getLockAquiredTime())) };
    String lockMsg = translator.translate(i18nLockMsgKey, i18nParams);
   
    Translator trans = Util.createPackageTranslator(DialogBoxUIFactory.class, ureq.getLocale());
    List<String> okButton = new ArrayList<String>();
    okButton.add(trans.translate("ok"));
   
    return new DialogBoxController(ureq, wControl, null, lockMsg, okButton);
  }
 
View Full Code Here

        warnings.append("<p>").append(trans.translate("mailhelper.error.failedusers"));
        warnings.append("<ul>");
        for (Identity identity : failedIdentites) {
          User user = identity.getUser();
          warnings.append("<li>");
          warnings.append(trans.translate("mailhelper.error.failedusers.user", new String[] { user.getProperty(UserConstants.FIRSTNAME, null), user.getProperty(UserConstants.LASTNAME, null),
              user.getProperty(UserConstants.EMAIL, null), identity.getName() }));
          warnings.append("</li>");
        }
        warnings.append("</ul></p>");
      }
View Full Code Here

  private String getPlaintextContent(Locale locale) {
    Translator trans = Util.createPackageTranslator(SubscriptionInfo.class, locale);
    Formatter form = Formatter.getInstance(locale);
    StringBuilder sb = new StringBuilder();
    String datePart = trans.translate("subscription.listitem.dateprefix", new String [] { form.formatDateAndTime(date) } ) ;
    sb.append("- ");
    sb.append(description.trim());
    sb.append(" ").append(datePart.trim());
    if (StringHelper.containsNonWhitespace(link)) sb.append("\n").append("  ").append(link);
    return sb.toString();
View Full Code Here

  private String getHTMLContent(Locale locale) {
    StringBuilder sb = new StringBuilder();
    Translator trans = Util.createPackageTranslator(SubscriptionInfo.class, locale);
    Formatter form = Formatter.getInstance(locale);
    String datePart = trans.translate("subscription.listitem.dateprefix", new String [] { form.formatDateAndTime(date) } ) ;
    if (iconCssClass != null) {
      sb.append("<li class=\"b_with_small_icon_left ");
      sb.append(iconCssClass);
      sb.append("\">");
    } else {
View Full Code Here

   * @param userObject
   * @return the controller
   */
  public static DialogController createYesNoDialogController(Locale locale, String text, ControllerEventListener cel, Object userObject) {
    Translator intTrans = new PackageTranslator(PACKAGE, locale);
    DialogController dc = new DialogController(locale, intTrans.translate("answer.yes"), intTrans.translate("answer.no"), text, userObject, true, null);
    // when used with basic controller listener has to be set with listenTo()
    if (cel != null) dc.addControllerListener(cel);
    return dc;
  }

View Full Code Here

   * @param userObject
   * @return the controller
   */
  public static DialogController createYesNoDialogController(Locale locale, String text, ControllerEventListener cel, Object userObject) {
    Translator intTrans = new PackageTranslator(PACKAGE, locale);
    DialogController dc = new DialogController(locale, intTrans.translate("answer.yes"), intTrans.translate("answer.no"), text, userObject, true, null);
    // when used with basic controller listener has to be set with listenTo()
    if (cel != null) dc.addControllerListener(cel);
    return dc;
  }

View Full Code Here

   * @param cel
   * @return the controller
   */
  public static DialogController createOkCancelDialogController(Locale locale, String text, ControllerEventListener cel) {
    Translator intTrans = new PackageTranslator(PACKAGE, locale);
    DialogController dc = new DialogController(locale, intTrans.translate("answer.ok"), intTrans.translate("answer.cancel"), text);
    // when used with basic controller listener has to be set with listenTo()   
    if (cel != null) dc.addControllerListener(cel);
    return dc;
  }

View Full Code Here

   * @param cel
   * @return the controller
   */
  public static DialogController createOkCancelDialogController(Locale locale, String text, ControllerEventListener cel) {
    Translator intTrans = new PackageTranslator(PACKAGE, locale);
    DialogController dc = new DialogController(locale, intTrans.translate("answer.ok"), intTrans.translate("answer.cancel"), text);
    // when used with basic controller listener has to be set with listenTo()   
    if (cel != null) dc.addControllerListener(cel);
    return dc;
  }

View Full Code Here

    Translator translator = getTranslator();

    GenericTreeModel gtm = new GenericTreeModel();
    rootTreeNode = new GenericTreeNode();
    //there should be i18n key for main.menu.title for the rootNode in package of implementing type
    rootTreeNode.setTitle(translator.translate("main.menu.title"));
    rootTreeNode.setAltText(translator.translate("main.menu.title.alt"));
    gtm.setRootNode(rootTreeNode);

    // Prepend
    boolean rootNodeSet = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.