Package org.olat.core.gui.translator

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


   * @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

    String detailedmessage = null;
    // translate user message if available
    if (o3e.getUsrMsgKey() != null && o3e.getUsrMsgPackage() != null) {
      PackageTranslator usrMsgTrans = new PackageTranslator(o3e.getUsrMsgPackage(), ureq.getLocale());
      if (o3e.getUsrMsgArgs() == null) {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey());
      } else {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey(), o3e.getUsrMsgArgs());
      }
    }
    // fix detailed message
View Full Code Here

    if (o3e.getUsrMsgKey() != null && o3e.getUsrMsgPackage() != null) {
      PackageTranslator usrMsgTrans = new PackageTranslator(o3e.getUsrMsgPackage(), ureq.getLocale());
      if (o3e.getUsrMsgArgs() == null) {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey());
      } else {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey(), o3e.getUsrMsgArgs());
      }
    }
    // fix detailed message
    if (detailedmessage == null) {
      if (o3e instanceof StaleObjectRuntimeException) {
View Full Code Here

   */
  public Emailer(Locale locale) {
    this.mailfrom =  WebappHelper.getMailConfig("mailFrom");
    // initialize the mail footer with info about this OLAt installation
    PackageTranslator trans = new PackageTranslator(Util.getPackageName(Emailer.class), locale);
    footer = trans.translate("footer.no.userdata", new String[] { Settings.getServerContextPathURI() });
  }

  /**
   * Constructs an Emailer which derives its <b>mail from address </b> from the
   * given <code>Identity</code>. The <b>mail host </b> used to send the
View Full Code Here

    Locale locale = I18nManager.getInstance().getLocaleOrDefault(user.getPreferences().getLanguage());
   
    PackageTranslator trans = new PackageTranslator(Util.getPackageName(Emailer.class), locale);
    String institution = user.getProperty(UserConstants.INSTITUTIONALNAME, null);
    if (institution == null) institution = "";
    footer = trans.translate("footer.with.userdata", new String[] { user.getProperty(UserConstants.FIRSTNAME, null), user.getProperty(UserConstants.LASTNAME, null), mailFromIdentity.getName(),
        institution, Settings.getServerContextPathURI()  });

  }

  /**
 
View Full Code Here

    int returnCode = mailerResult.getReturnCode();
    List<Identity> failedIdentites = mailerResult.getFailedIdentites();

    // first the severe errors
    if (returnCode == MailerResult.SEND_GENERAL_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.send.general")).append("</p>");
    } else if (returnCode == MailerResult.SENDER_ADDRESS_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.sender.address")).append("</p>");
    } else if (returnCode == MailerResult.RECIPIENT_ADDRESS_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.recipient.address")).append("</p>");
    } else if (returnCode == MailerResult.TEMPLATE_GENERAL_ERROR) {
View Full Code Here

    // first the severe errors
    if (returnCode == MailerResult.SEND_GENERAL_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.send.general")).append("</p>");
    } else if (returnCode == MailerResult.SENDER_ADDRESS_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.sender.address")).append("</p>");
    } else if (returnCode == MailerResult.RECIPIENT_ADDRESS_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.recipient.address")).append("</p>");
    } else if (returnCode == MailerResult.TEMPLATE_GENERAL_ERROR) {
      errors.append("<p>").append(trans.translate("mailhelper.error.template.general")).append("</p>");
    } else if (returnCode == MailerResult.TEMPLATE_PARSE_ERROR) {
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.