Package org.olat.core.gui.translator

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


   * @param wControl
   */
  public AddNewQTIDocumentController(String type, RepositoryAddCallback addCallback, UserRequest ureq, WindowControl wControl) {
    super(wControl);   
    this.type = type;
    this.translator = new PackageTranslator(PACKAGE_REPOSITORY, ureq.getLocale());
    this.locale = ureq.getLocale();
    if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) {
      resource = new TestFileResource();
    } else if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
      resource = new SurveyFileResource();
View Full Code Here


 
  private List<String> subscriptionIds;

  public KalendarConfigurationController(List<KalendarRenderWrapper> calendars, UserRequest ureq, WindowControl wControl, boolean insideManager, boolean canUnsubscribe) {
    super(ureq, wControl);
    setTranslator(new PackageTranslator(PACKAGE, ureq.getLocale()));
   
    configVC = new VelocityContainer("calEdit", VELOCITY_ROOT + "/calConfig.html", getTranslator(), this);
    setCalendars(ureq, calendars);
    configVC.contextPut("insideManager", insideManager);
    configVC.contextPut("identity", ureq.getIdentity());
View Full Code Here

   */
  public CourseSharedFolderController(UserRequest ureq, WindowControl wControl, CourseConfig courseConfig) {
    super(wControl);

    this.courseConfig = courseConfig;
    translator = new PackageTranslator(PACKAGE, ureq.getLocale());
   
    myContent = new VelocityContainer("courseSharedFolderTab", VELOCITY_ROOT + "/CourseSharedFolder.html", translator, this);
    changeSFResButton = LinkFactory.createButton("sf.changesfresource", myContent, this);
    unselectSFResButton = LinkFactory.createButton("sf.unselectsfresource", myContent, this);
    selectSFResButton = LinkFactory.createButton("sf.selectsfresource", myContent, this);
View Full Code Here

   * @param ureq
   * @param wControl
   */
  protected CalendarPortletRunController(UserRequest ureq, WindowControl wControl) {
    super(wControl);
    trans = new PackageTranslator(Util.getPackageName(CalendarPortletRunController.class), ureq.getLocale());
    calendarVC = new VelocityContainer("calendarVC", VELOCITY_ROOT + "/calendarPortlet.html", trans, this);
    showAllLink = LinkFactory.createLink("calendar.showAll", calendarVC, this);
    ComponentUtil.registerForValidateEvents(calendarVC, this);
   
    Date date = new Date();
View Full Code Here

   */
  public CreateNewGlossaryController(RepositoryAddCallback addCallback, UserRequest ureq, WindowControl wControl) {
    super(wControl);
    if (addCallback != null) {
      newFileResource = GlossaryManager.getInstance().createGlossary();
      Translator trnsltr = new PackageTranslator("org.olat.repository", ureq.getLocale());
      addCallback.setDisplayName(trnsltr.translate(newFileResource.getResourceableTypeName()));
      addCallback.setResourceable(newFileResource);
      addCallback.setResourceName("-");
      addCallback.finished(ureq);
    }
  }
View Full Code Here

   * @param course
   * @param locale
   * @return String
   */
  public static String createCourseResultsOverviewTable(List identities, List myNodes, ICourse course, Locale locale) {
      Translator t = new PackageTranslator(PACKAGE, locale);
      StringBuilder tableHeader1 = new StringBuilder();
    StringBuilder tableHeader2 = new StringBuilder();
    StringBuilder tableContent = new StringBuilder();
    StringBuilder table = new StringBuilder();

    String sequentialNumber = t.translate("column.header.seqnum");
    String login = t.translate("column.header.login");
    // user properties are dynamic
    String sc = t.translate("column.header.score");
    String pa = t.translate("column.header.passed");
    String co = t.translate("column.header.comment");
    String cco = t.translate("column.header.coachcomment");
    String at = t.translate("column.header.attempts");
    String na = t.translate("column.field.notavailable");
    String mi = t.translate("column.field.missing");
    String yes = t.translate("column.field.yes");
    String no = t.translate("column.field.no");

   
    tableHeader1.append(sequentialNumber);
    tableHeader1.append("\t");
    tableHeader2.append("\t");
   
    tableHeader1.append(login);
    tableHeader1.append("\t");
    tableHeader2.append("\t");
    // get user property handlers for this export, translate using the fallback
    // translator configured in the property handler
   
    List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(
        ScoreAccountingHelper.class.getCanonicalName(), true);
    t = UserManager.getInstance().getPropertyHandlerTranslator(t);
    for (UserPropertyHandler propertyHandler : userPropertyHandlers) {
      tableHeader1.append(t.translate(propertyHandler.i18nColumnDescriptorLabelKey()));
      tableHeader1.append("\t");     
      tableHeader2.append("\t");
    }       

    // preload user properties cache
    course.getCourseEnvironment().getAssessmentManager().preloadCache();
   
    boolean firstIteration = true;
    int rowNumber = 1;
    Iterator iterIdentities = identities.iterator();
    while (iterIdentities.hasNext()) {
      Identity identity = (Identity) iterIdentities.next();
      String uname = identity.getName();

      tableContent.append(rowNumber);
      tableContent.append("\t");
      tableContent.append(uname);
      tableContent.append("\t");
      // add dynamic user properties
      for (UserPropertyHandler propertyHandler : userPropertyHandlers) {
        String value = propertyHandler.getUserProperty(identity.getUser(), t.getLocale());
        tableContent.append((StringHelper.containsNonWhitespace(value) ? value : na));
        tableContent.append("\t");     
      }

      // create a identenv with no roles, no attributes, no locale
View Full Code Here

    init(secCallback, ureq);
  }

  private void init(IQSecurityCallback secCallback, UserRequest ureq) {
    this.iqsec = secCallback;
    this.translator = new PackageTranslator(PACKAGE, ureq.getLocale());
    this.ready = false;
   
    // acquire the back-handling, so that (unintended) back-clicks will not throw you out of a test, but shows a message instead.
    getWindowControl().getWindowBackOffice().acquireBackHandling(this);
View Full Code Here

   *
   * @param locale
   * @return
   */
  public String getShortDescription(Locale locale) {
    Translator f = new PackageTranslator(fallbackTranslatorStr, locale);
    Translator t = new PackageTranslator(transPckg, locale, f);
    return t.translate(shortDesc, params);
  }
View Full Code Here

   *
   * @param locale
   * @return
   */
  public String getLongDescription(Locale locale) {
    Translator f = new PackageTranslator(fallbackTranslatorStr, locale);
    Translator t = new PackageTranslator(transPckg, locale, f);
    return t.translate(longDesc, params);
  }
View Full Code Here

    } else if (groupContexts.size() == 1) {
      BGContext context = (BGContext) groupContexts.get(0);
      doInitGroupmanagement(ureq, context, false);
    } else {
      // multiple, show list first
      Translator fallback = new PackageTranslator(Util.getPackageName(BGContextEditController.class), ureq.getLocale());
      setTranslator(Util.createPackageTranslator(this.getClass(), ureq.getLocale(), fallback));
      doInitContextListLayout(ureq);
      doInitContextList(ureq, groupContexts);
    }
   
View Full Code Here

TOP

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

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.