Package org.olat.core.gui.translator

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


   
    main = createVelocityContainer("publish");
    pblNothingButton = LinkFactory.createButton("pbl.nothing.button", main, this);
   
    repositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(course, false);
    accessForm = new AccessForm("accessForm", repositoryEntry, new PackageTranslator(ACCESS_PACKAGE, ureq.getLocale(),getTranslator()));
    accessForm.addListener(this);
    main.put("accessForm", accessForm);
   
    selectionTree = new SelectionTree("selTree", getTranslator());
//REFACTOR  selectionTree.setTreeModel(publishTreeModel);
View Full Code Here


     * @param preselectedNames String containing the comma separated names that should be preselected
     * @param htmlElemId the name of the html id of the window that opened this popup controller
     */
    public GroupAndAreaSelectController(UserRequest ureq, WindowControl wControl, CourseGroupManager cgm, int type, String preselectedNames, String htmlElemId) {
        super(wControl);
        Translator trans = new PackageTranslator(PACKAGE,  ureq.getLocale());
        List namesList;
        this.htmlElemId = htmlElemId;
        // main window containg title and the cooser list
        main = new VelocityContainer("main",VELOCITY_ROOT + "/groupandareaselect.html", trans, this);

        // initialize some type specific stuff
        switch (type) {
        case 1:
            namesList = cgm.getUniqueLearningGroupNamesFromAllContexts();           
            main.contextPut("title", trans.translate("groupandareaselect.groups.title"));
            main.contextPut("noChoicesText", trans.translate("groupandareaselect.groups.nodata"));
            break;
        case 2:
            namesList = cgm.getUniqueAreaNamesFromAllContexts();           
            main.contextPut("title", trans.translate("groupandareaselect.areas.title"));
            main.contextPut("noChoicesText", trans.translate("groupandareaselect.areas.nodata"));
            break;
        default:
            throw new OLATRuntimeException("Must use valid type. type::" + type, null);
        }
       
View Full Code Here

    super(wControl);
    if (addCallback != null) {
      FeedManager manager = FeedManager.getInstance();
      // Create a new podcast feed resource
      feedResource = manager.createBlogResource();
      Translator trans = new PackageTranslator("org.olat.repository", ureq.getLocale());
      addCallback.setDisplayName(trans.translate(feedResource.getResourceableTypeName()));
      addCallback.setResourceable(feedResource);
      addCallback.setResourceName(manager.getFeedKind(feedResource));
      addCallback.finished(ureq);
    }
  }
View Full Code Here

      String[] identifyerSplit = helpPageIdentifyer.split(":");
      String bundleName = identifyerSplit[0];
      String page = identifyerSplit[1];
      // Translator with default locale. Locale is set to each language in the
      // language iteration below
      Translator pageTranslator = new PackageTranslator(bundleName, I18nModule.getDefaultLocale());
      // Open velocity page for this help page
      String pagePath = bundleName.replace('.', '/') + ContextHelpModule.CHELP_DIR + page;
      VelocityContainer container =  new VelocityContainer("contextHelpPageVC", pagePath, pageTranslator, null);         
      Context ctx = container.getContext();   
      GlobalSettings globalSettings = new GlobalSettings() {
        public int getFontSize() { return 100;}
        public AJAXFlags getAjaxFlags() { return new EmptyAJAXFlags();}
        public ComponentRenderer getComponentRendererFor(Component source) {
          return null;
        }
        public boolean isIdDivsForced() { return false; }
      };
      Renderer renderer = Renderer.getInstance(container, pageTranslator, new EmptyURLBuilder(), null, globalSettings);
      // Add render decorator with helper methods
      VelocityRenderDecorator vrdec = new VelocityRenderDecorator(renderer, container);     
      ctx.put("r", vrdec);
      // Add empty static dir url - only used to not generate error messages
      ctx.put("chelpStaticDirUrl", "");
      // Create document for each language using the velocity context
      for (String langCode : languages) {
        Locale locale = I18nManager.getInstance().getLocaleOrNull(langCode);
        String relPagePath = langCode + "/" + bundleName + "/" + page;
        if (log.isDebug()) log.debug("Indexing help page with path::" + relPagePath);
        SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
        searchResourceContext.setBusinessControlFor(OresHelper.createOLATResourceableType(ContextHelpModule.class.getSimpleName()));//to match the list of indexer
        // Create context help document and index now, set translator to current locale
        pageTranslator.setLocale(locale);
        Document document = ContextHelpDocument.createDocument(searchResourceContext, bundleName, page, pageTranslator, ctx, pagePath);
        indexWriter.addDocument(document);
      }
     
    }
View Full Code Here

   * @param config the module configuration
   */
  public TunnelController(UserRequest ureq, WindowControl wControl, ModuleConfiguration config) {
    super(wControl);
    this.config = config;
    PackageTranslator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    main = new VelocityContainer("tucMain", VELOCITY_ROOT + "/index.html", trans, null);
    tuc = new TunnelComponent("tuc", config, ureq);
    main.put("tuc", tuc);
    setInitialComponent(main);
  }
View Full Code Here

    super(wControl);
    if (addCallback != null) {
      FeedManager manager = FeedManager.getInstance();
      // Create a new podcast feed resource
      feedResource = manager.createPodcastResource();
      Translator trans = new PackageTranslator("org.olat.repository", ureq.getLocale());
      addCallback.setDisplayName(trans.translate(feedResource.getResourceableTypeName()));
      addCallback.setResourceable(feedResource);
      addCallback.setResourceName(manager.getFeedKind(feedResource));
      addCallback.finished(ureq);
    }
  }
View Full Code Here

   * @param th
   * @param detailedmessage
   * @param supportEmail
   */
  public MessageWindowController(UserRequest ureq, Throwable th, String detailedmessage, String supportEmail) {
    Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    //Formatter formatter = Formatter.getInstance(ureq.getLocale());
    msg = new VelocityContainer("olatmain", VELOCITY_ROOT + "/message.html", trans, this);
           
    Tracing.logWarn(th.getMessage() + " *** User info: " + detailedmessage, th.getClass());
   
View Full Code Here

   * 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

   * constructs an unitialised BusinessGroup, use setXXX for setting attributes
   */
  public BusinessGroupArchiver() {
    securityManager = ManagerFactory.getManager();
    String groupCtrlPackage = Util.getPackageName(GroupController.class);
    PackageTranslator fallBacktranslator = new PackageTranslator(groupCtrlPackage, I18nModule.getDefaultLocale());
    String myPackage = Util.getPackageName(this.getClass());
    translator = new PackageTranslator(myPackage, I18nModule.getDefaultLocale(), fallBacktranslator);
    // fallback to translate user properties
    translator = UserManager.getInstance().getPropertyHandlerTranslator(translator);
    // get user property handlers used in this group archiver
    userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(BusinessGroupArchiver.class.getCanonicalName(), true);
  }
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

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.