Package org.olat.core.gui.translator

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


   * @param res
   * @param locale
   * @return Components displaying details of a file resource.
   */
  public Component getDetailsComponent(OLATResourceable res, Locale locale) {
    Translator translator = Util.createPackageTranslator(this.getClass(), locale);
    return new FileDetailsForm("fileDetails", translator, res);
  }
View Full Code Here


    showOtherUsers.setAjaxEnabled(false);
    showOtherUsers.setTarget("_blanc");
    if (isGuest) showOtherUsers.setEnabled(false);
   
    // some variables displayed in the footer
    Translator translator = getTranslator();
    olatFootervc.contextPut("username", identity != null && !isGuest.booleanValue() ? translator.translate("username", new String[] { identity.getName() })
        : translator.translate("not.logged.in"));
    Version v = (Version) CoreSpringFactory.getBean("org.olat.core.Version");
    String nodeInfo = (!CoordinatorManager.getCoordinator().isClusterMode()) ? "" : (", N"+CoordinatorManager.getCoordinator().getNodeId());
    olatFootervc.contextPut("olatversion", v.getFullVersion() + nodeInfo);
    // instant messaging awareness
    olatFootervc.contextPut("instantMessagingEnabled", new Boolean(InstantMessagingModule.isEnabled()));
View Full Code Here

   */
  public CreateNewSharedFolderController(RepositoryAddCallback addCallback, UserRequest ureq, WindowControl wControl) {
    super(wControl);
    if (addCallback != null) {
      newFileResource = SharedFolderManager.getInstance().createSharedFolder();
      Translator trnsltr = new PackageTranslator("org.olat.repository", ureq.getLocale());
      addCallback.setDisplayName(trnsltr.translate(newFileResource.getResourceableTypeName()));
      addCallback.setResourceable(newFileResource);
      addCallback.setResourceName(SharedFolderFileResource.RESOURCE_NAME);

      addCallback.finished(ureq);
    }
View Full Code Here

    if (column==0) {
      return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
    }
   
    if (headerId!=null) {
      Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
      if (translator!=null) {
        String newHeaderId = translator.translate("swissEduPersonStudyBranch3."+headerId);
        if (newHeaderId!=null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
          headerId = newHeaderId;
        }
      }
    }
View Full Code Here

          }
        }
        DialogElementsPropertyManager mgr = DialogElementsPropertyManager.getInstance();
        DialogPropertyElements elements = mgr.findDialogElements(p.getResId(), p.getSubidentifier());
        final List<DialogElement> dialogElements = elements.getDialogPropertyElements();
        final Translator translator = Util.createPackageTranslator(FileUploadNotificationHandler.class, locale);

        si = new SubscriptionInfo(new TitleItem(translator.translate("notifications.header", new String[]{displayname}), CSSS_CLASS_UPLOAD_ICON), null);
        SubscriptionListItem subListItem;
        for (DialogElement element : dialogElements) {
          // do only show entries newer then the ones already seen
          if (element.getDate().after(compareDate)) {
            String filename = element.getFilename();
            String creator = element.getAuthor();
            Identity ident = ManagerFactory.getManager().findIdentityByName(creator);
            Date modDate = element.getDate();

            String desc = translator.translate("notifications.entry", new String[] { filename, NotificationHelper.getFormatedName(ident) });
            String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, p.getBusinessPath());
            String cssClass = CSSHelper.createFiletypeIconCssClassFor(filename);

            subListItem = new SubscriptionListItem(desc, urlToSend, modDate, cssClass);
            si.addSubscriptionListItem(subListItem);
View Full Code Here

  }

  @Override
  public String createTitleInfo(Subscriber subscriber, Locale locale) {
    try {
      Translator translator = Util.createPackageTranslator(FileUploadNotificationHandler.class, locale);
      String displayname = RepositoryManager.getInstance().lookupDisplayNameByOLATResourceableId(subscriber.getPublisher().getResId());
      if(displayname == null) {
        checkPublisher(subscriber.getPublisher());
      }
      return translator.translate("notifications.header", new String[]{displayname});
    } catch (Exception e) {
      log.error("Error while creating assessment notifications for subscriber: " + subscriber.getKey(), e);
      checkPublisher(subscriber.getPublisher());
      return "-";
    }
View Full Code Here

  /**
   * @see org.olat.ims.qti.container.qtielements.GenericQTIElement#render(java.lang.StringBuilder, org.olat.ims.qti.container.qtielements.RenderInstructions)
   */
  public void render(StringBuilder buffer, RenderInstructions ri) {
    Translator translator = new PackageTranslator(PACKAGE_QTI, (Locale)ri.get(RenderInstructions.KEY_LOCALE));
    buffer.append("<div id=\"o_qti_hints\"><a href=\"#\" onclick=\"b_togglebox('o_qti_hints_inner', this);\" onkeypress=\"b_togglebox('o_qti_hints_inner', this);\">");
    buffer.append(translator.translate("render.hint"));
    buffer.append("</a><div id=\"o_qti_hints_inner\" style=\"display:none\"><div><div class=\"b_important\">");
    super.render(buffer, ri);
    buffer.append("</div></div></div></div>");
  }
View Full Code Here

    //we like to have a link in the testing tab menu
    //elements.putExtensionElement(TestingMainController.class.getName(), new ActionExtension() {
    elements.putExtensionElement(HomeMainController.class.getName(), new ActionExtension() {
      //the "alt" text for the link
      public String getDescription(Locale loc) {
        Translator translator = Util.createPackageTranslator(this.getClass(), loc);
        return translator.translate("helloWorld.description");
      }
      //the link text
      public String getActionText(Locale loc) {
        Translator translator = Util.createPackageTranslator(this.getClass(), loc);
        return translator.translate("helloWorld.action");
      }
      //the controller the link creates clicking on it
      public Controller createController(UserRequest ureq, WindowControl wControl, Object arg) {
        Controller controller = new HelloWorldController(ureq, wControl);
        return controller;
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

    if (column==0) {
      return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
    }

    if (headerId!=null) {
      Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
      if (translator!=null) {
        String newHeaderId = translator.translate("swissEduPersonStudyLevel."+headerId);
        if (newHeaderId!=null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
          headerId = newHeaderId;
        }
      }
    }
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.