Package org.olat.core.gui.translator

Examples of org.olat.core.gui.translator.Translator


   * Get the condition editor wrapped as a generic accessability condition editor
   * @param title The title of this access condition, displayed as header in the surrounding fieldset
   * @return The wrapped condition editor component
   */
  public VelocityContainer getWrappedDefaultAccessConditionVC(String title){
    Translator accessTranslator = new PackageTranslator(PACKAGE_EDITOR, getLocale());
    VelocityContainer defaultAccessConditionView = new VelocityContainer("defaultAccessConditionView", VELOCITY_ROOT + "/defaultaccessedit.html", accessTranslator, null);
    defaultAccessConditionView.put("defaultAccessConditionView", myContent);
    defaultAccessConditionView.contextPut("title", title);
    return defaultAccessConditionView;
  }
View Full Code Here


   */
  public static MainLayoutController createLaunchController(RepositoryEntry re, String initialViewIdentifier, UserRequest ureq, WindowControl wControl) {
    if (re == null) return null;
    RepositoryManager rm = RepositoryManager.getInstance();
    if (!rm.isAllowedToLaunch(ureq, re)) {
      Translator trans = Util.createPackageTranslator(RepositoyUIFactory.class, ureq.getLocale());
      String text = trans.translate("launch.noaccess");
      Controller c = MessageUIFactory.createInfoMessage(ureq, wControl, null, text);
     
      // use on column layout
      LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, c.getInitialComponent(), null);
      layoutCtr.addDisposableChildController(c); // dispose content on layout dispose
View Full Code Here

        }
      }
    }
    Locale userLocale = ureq.getLocale();
    String charset = UserManager.getInstance().getUserCharset(ureq.getIdentity());
    Translator trans = getPackageTranslator(userLocale);
    List<OrganisationalEntity> organisationalEntityList = getOrganisationalEntityList(areaList);
    return generateArchiveFile(context, owners, participants, waitings, columnList, organisationalEntityList,
        trans.translate("archive.areas"), archiveType, userLocale, charset);
  }
View Full Code Here

  /**
   * @param l the locale for translating the operators labels
   * @return the translated labels for all registered operators
   */
  public static String[] getAllRegisteredAndAlreadyTranslatedOperatorLabels(Locale l) {
    Translator t = new PackageTranslator(OperatorManager.class.getPackage().getName(), l);
    String[] tmp = new String[ops.size()];
    int i = 0;
    for (Operator o : ops) {
      tmp[i++] = t.translate(o.getLabelKey());
    }
    return tmp;
  }
View Full Code Here

    return tmp;
  }

  public static String[] getRegisteredAndAlreadyTranslatedOperatorLabels(Locale locale, String[] operatorKeys) {
    List<String> keys = Arrays.asList(operatorKeys);
    Translator t = new PackageTranslator(OperatorManager.class.getPackage().getName(), locale);
    String[] tmp = new String[ops.size()];
    int i = 0;
    for (Operator o : ops) {
      if(keys.contains(o.getOperatorKey())) {
        tmp[i++] = t.translate(o.getLabelKey());
      }
    }
    return tmp;
  }
View Full Code Here

      }
    }

    Locale userLocale = ureq.getLocale();
    String charset = UserManager.getInstance().getUserCharset(ureq.getIdentity());
    Translator trans = getPackageTranslator(userLocale);
    List<OrganisationalEntity> organisationalEntityList = getOrganisationalEntityList(groupList);
    return generateArchiveFile(context, owners, participants, waitings, columnList, organisationalEntityList,
        trans.translate("archive.groups"), archiveType, userLocale, charset);
  }
View Full Code Here

  private File generateArchiveFile(BGContext context, List<Member> owners, List<Member> participants, List<Member> waitings,
      List<String> columnList, List<OrganisationalEntity> organisationalEntityList, String orgEntityTitle, String archiveType,
      Locale userLocale, String charset) {
    //TODO: sort member lists
    File outFile = null;
    Translator trans = getPackageTranslator(userLocale);   
    String archiveTitle = trans.translate("archive.title") + ": " + DefaultContextTranslationHelper.translateIfDefaultContextName(context, trans);
    try {
    if (ALL_IN_ONE.equals(archiveType)) {
      //File tempDir = getTempDir();
      outFile = archiveAllInOne(context, owners, participants, waitings, archiveTitle, columnList, organisationalEntityList,
          orgEntityTitle, userLocale, ALL_IN_ONE_FILE_NAME_PREFIX, null, charset);
View Full Code Here

      List<String> columnList, List<OrganisationalEntity> organisationalEntityList, String orgEntityTitle, Locale userLocale,
      String fileNamePrefix, File tempDir, String charset) throws IOException {
    File outFile = null;
    StringBuffer stringBuffer = new StringBuffer();

    Translator trans = getPackageTranslator(userLocale);   
    Translator propertyHandlerTranslator = UserManager.getInstance().getPropertyHandlerTranslator(trans);
    appendContextInfo(stringBuffer, context, userLocale);
    if (owners.size() > 0) {
      appendSection(stringBuffer, trans.translate("archive.header.owners"), owners, columnList, organisationalEntityList, orgEntityTitle,
          propertyHandlerTranslator, OWNER);
    }
View Full Code Here

    return outFile;
  }
 
  private void appendInternInfo(StringBuffer buf, String title, Locale userLocale) {
    Translator trans = getPackageTranslator(userLocale)
    buf.append(EOL);
    buf.append(trans.translate("archive.interninfo"));
    buf.append(EOL);
    buf.append(title);
    buf.append(EOL);
  }
View Full Code Here

      List<String> columnList, List<OrganisationalEntity> organisationalEntityList, String orgEntityTitle, Locale userLocale, String fileNamePrefix,
      File tempDir, String charset) throws IOException {
    File outFile = null;
    StringBuffer stringBuffer = new StringBuffer();

    Translator trans = getPackageTranslator(userLocale);
    Translator propertyHandlerTranslator = UserManager.getInstance().getPropertyHandlerTranslator(trans);
    // choice element has only one selected entry
    List<String> titles = getCourseTitles (context);
    Iterator<String> titleIterator = titles.iterator();
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, userLocale);
    String formattedDate = dateFormat.format(new Date());
View Full Code Here

TOP

Related Classes of org.olat.core.gui.translator.Translator

Copyright © 2018 www.massapicom. 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.