Package org.olat.core.gui.translator

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


      if (translated.indexOf(PackageTranslator.NO_TRANSLATION_ERROR_PREFIX) == 0) {
         Translator translator = UserManager.getInstance().getPropertyHandlerTranslator(getTranslator());
         String prefix = "form.name.";
          // OLAT-5089: use translate(String key, String[] args, boolean fallBackToDefaultLocale) version
          //            of Translator because that's the only one not
         translated = translator.translate(prefix + key, null, Level.OFF);
         if (translated.indexOf(PackageTranslator.NO_TRANSLATION_ERROR_PREFIX) == 0) {
           // could not translate this key, use key for non-translated values
           guiTranslatedAttKeys[j] = key;
         } else {
           guiTranslatedAttKeys[j] = translated;
View Full Code Here


    formLayout.add(assessSubContainer);

    Translator translator = getTranslator();

    final String[] assessmentSwitchKeys = new String[] { NODEPASSED_VAL_PASSED, NODEPASSED_VAL_SCORE };
    final String[] assessmentSwitchValues = new String[] { translator.translate("form.easy.assessmentSwitch.passed"),
        translator.translate("form.easy.assessmentSwitch.score") };

    String nodePassedInitVal = validatedCondition.getEasyModeNodePassedId();
    String cutInitStrValue = validatedCondition.getEasyModeCutValue();
    int cutInitValue = 0;
View Full Code Here

    Translator translator = getTranslator();

    final String[] assessmentSwitchKeys = new String[] { NODEPASSED_VAL_PASSED, NODEPASSED_VAL_SCORE };
    final String[] assessmentSwitchValues = new String[] { translator.translate("form.easy.assessmentSwitch.passed"),
        translator.translate("form.easy.assessmentSwitch.score") };

    String nodePassedInitVal = validatedCondition.getEasyModeNodePassedId();
    String cutInitStrValue = validatedCondition.getEasyModeCutValue();
    int cutInitValue = 0;
   
View Full Code Here

    List<String> keysList = new ArrayList<String>();
    List<String> valuesList = new ArrayList<String>();
    if (nodeIdentList.size() > 0) {
      // there are nodes to be selected
      keysList.add(NO_NODE_SELECTED_IDENTIFYER);
      valuesList.add("- " + translator.translate("form.easy.nodePassed.select") + " -");
      for (int i = 0; i < nodeIdentList.size(); i++) {
        CourseNode courseNode = (CourseNode) nodeIdentList.get(i);
        keysList.add(courseNode.getIdent());
        valuesList.add(courseNode.getShortName() + " (Id:" + courseNode.getIdent() + ")");
        if (courseNode.getIdent().equals(nodePassedInitVal)) selectedNodeIsInList = true;
View Full Code Here

        if (courseNode.getIdent().equals(nodePassedInitVal)) selectedNodeIsInList = true;
      }
    } else {
      // no nodes to be selected
      keysList.add(NO_NODE_SELECTED_IDENTIFYER);
      valuesList.add("- " + translator.translate("form.easy.nodePassed.noNodes"));
      //disable switch
      assessmentSwitch.setEnabled(false);
    }
    // add dummy value if needed
    if (nodePassedInitVal != null && !selectedNodeIsInList) {
View Full Code Here

      assessmentSwitch.setEnabled(false);
    }
    // add dummy value if needed
    if (nodePassedInitVal != null && !selectedNodeIsInList) {
      keysList.add(DELETED_NODE_IDENTIFYER);
      valuesList.add("- " + translator.translate("form.easy.nodePassed.deletedNode") + " -");
    }
    final String[] nodePassedKeys = new String[keysList.size()];
    keysList.toArray(nodePassedKeys);
    final String[] nodePassedValues = new String[valuesList.size()];
    valuesList.toArray(nodePassedValues);
View Full Code Here

  public boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    ReferenceManager refM = ReferenceManager.getInstance();
    String referencesSummary = refM.getReferencesToSummary(res, ureq.getLocale());
    if (referencesSummary != null) {
      Translator translator = new PackageTranslator(PACKAGE, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.references",
          new String[] { referencesSummary }));
      return false;
    }
    /*
     * make an archive of the course nodes with valuable data
View Full Code Here

  public boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    ReferenceManager refM = ReferenceManager.getInstance();
    String referencesSummary = refM.getReferencesToSummary(res, ureq.getLocale());
    if (referencesSummary != null) {
      Translator translator = Util.createPackageTranslator(RepositoryManager.class, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary }));
      return false;
    }
    return true;
  }
View Full Code Here

          Translator userTrans = Util.createPackageTranslator(PwChangeController.class, locale) ;
          String emailAdress = identity.getUser().getProperty(UserConstants.EMAIL, locale);
          TemporaryKey tk = rm.loadTemporaryKeyByEmail(emailAdress);
          if (tk == null) tk = rm.createTemporaryKeyByEmail(emailAdress, ip, rm.PW_CHANGE);
          myContent.contextPut("pwKey", tk.getRegistrationKey());
          body = userTrans.translate("pwchange.intro", new String[] { identity.getName() })
              + userTrans.translate("pwchange.body", new String[] { serverpath, tk.getRegistrationKey(),
                  I18nManager.getInstance().getLocaleKey(ureq.getLocale()) }) + SEPARATOR
              + userTrans.translate("reg.wherefrom", new String[] { serverpath, today, ip });
          subject = userTrans.translate("pwchange.subject");
          MailTemplate mailTempl = new MailTemplate(subject, body, null) {
View Full Code Here

          String emailAdress = identity.getUser().getProperty(UserConstants.EMAIL, locale);
          TemporaryKey tk = rm.loadTemporaryKeyByEmail(emailAdress);
          if (tk == null) tk = rm.createTemporaryKeyByEmail(emailAdress, ip, rm.PW_CHANGE);
          myContent.contextPut("pwKey", tk.getRegistrationKey());
          body = userTrans.translate("pwchange.intro", new String[] { identity.getName() })
              + userTrans.translate("pwchange.body", new String[] { serverpath, tk.getRegistrationKey(),
                  I18nManager.getInstance().getLocaleKey(ureq.getLocale()) }) + SEPARATOR
              + userTrans.translate("reg.wherefrom", new String[] { serverpath, today, ip });
          subject = userTrans.translate("pwchange.subject");
          MailTemplate mailTempl = new MailTemplate(subject, body, null) {
            @Override
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.