Package org.olat.core.gui.translator

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


   * @see org.olat.gui.control.generic.portal.AbstractPortlet#createInstance(org.olat.core.gui.control.WindowControl, org.olat.core.gui.UserRequest, java.util.Map)
   */
  public Portlet createInstance(WindowControl wControl, UserRequest ureq, Map configuration) {
    IframePortlet p = new IframePortlet();
    p.setConfiguration(configuration);
    p.setTranslator(new PackageTranslator(Util.getPackageName(IframePortlet.class), ureq.getLocale()));
    // override css class if configured
    String cssClass = (String)configuration.get("cssWrapperClass");
    if (cssClass != null) p.setCssWrapperClass(cssClass);
    return p;
  }
View Full Code Here


   * Internal constructor
   * @param ureq
   */
  protected DidYouKnowPortletRunController(UserRequest ureq, WindowControl wControl) {
    super(wControl);
    this.trans = new PackageTranslator(Util.getPackageName(DidYouKnowPortlet.class), ureq.getLocale());
    this.didYouKnowVC = new VelocityContainer("didYouKnowVC", VELOCITY_ROOT + "/didYouKnowPortlet.html", trans, this);
    nextLink = LinkFactory.createLink("next", didYouKnowVC, this);
   
    // get tips boundary initialize a shuffled list of all possible tip numbers
    int numbTips = -1;
View Full Code Here

    for (int i = 0; i < pageIdentifyers.size(); i++) {
      String pageIdentifyer = pageIdentifyers.get(i);
      int splitPos = pageIdentifyer.indexOf(":");
      String bundleName = pageIdentifyer.substring(0, splitPos);
      String page = pageIdentifyer.substring(splitPos+1);
      PackageTranslator pageTans = new PackageTranslator(bundleName, getLocale());
      String pageTitle = pageTans.translate("chelp." + page.split("\\.")[0] + ".title");
      Link link = LinkFactory.createLink(i+"", tocVC, this);
      link.setCustomDisplayText(pageTitle);
      link.setUserObject(pageIdentifyer);
      // add to list of links and names
      tocVC.put(i+"", link);
View Full Code Here

      link.getTranslator().setLocale(locale);
      String pageIdentifyer = (String) link.getUserObject();
      int splitPos = pageIdentifyer.indexOf(":");
      String bundleName = pageIdentifyer.substring(0, splitPos);
      String page = pageIdentifyer.substring(splitPos+1);
      PackageTranslator pageTans = new PackageTranslator(bundleName, locale);
      String pageTitle = pageTans.translate("chelp." + page.split("\\.")[0] + ".title");
      link.setCustomDisplayText(pageTitle);
    }
    // Update title in view
    tocVC.setDirty(true);
    // Update next crumb in chain
View Full Code Here

   * @see org.olat.gui.control.generic.portal.AbstractPortlet#createInstance(org.olat.core.gui.control.WindowControl, org.olat.core.gui.UserRequest, java.util.Map)
   */
  public Portlet createInstance(WindowControl wControl, UserRequest ureq, Map configuration) {
    Portlet p = new DidYouKnowPortlet();
    p.setConfiguration(configuration);
    p.setTranslator(new PackageTranslator(Util.getPackageName(DidYouKnowPortlet.class), ureq.getLocale()));
    return p;
  }
View Full Code Here

   */
  public static Translator createPackageTranslator(Class baseClass, Locale locale, Translator fallback) {
    String transpackage = Util.getPackageName(baseClass);
    Translator trans;
    if(fallback != null) {
      trans = new PackageTranslator(transpackage, locale, fallback);
    } else {
      trans = new PackageTranslator(transpackage, locale);
    }
   
    return trans;
  }
View Full Code Here

    super(wControl);
    this.mailTemplate = mailTemplate;
    orgMailSubject = mailTemplate.getSubjectTemplate();
    orgMailBody = mailTemplate.getBodyTemplate();
    cpFrom = mailTemplate.getCpfrom();
    this.trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    this.mainVC = new VelocityContainer("mainVC", VELOCITY_ROOT + "/mailnotification.html", trans, this);
    this.mailForm = new MailTemplateForm(ureq.getLocale(), mailTemplate, useCancel, this);
    this.mainVC.put("mailForm", mailForm);
    setInitialComponent(mainVC);
  }
View Full Code Here

    }

    @Override
    @SuppressWarnings("unused")
    protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
      PackageTranslator pt = (PackageTranslator) Util.createPackageTranslator(PropPupForm.class, getLocale(), getTranslator());
     
      FormItemContainer fic = FormLayoutContainer.createCustomFormLayout("access", pt, this.velocity_root+"/publish_courseaccess.html");
      formLayout.add(fic);
      String[] keys = new String[] {
          "" + RepositoryEntry.ACC_OWNERS,
          "" + RepositoryEntry.ACC_OWNERS_AUTHORS,
          "" + RepositoryEntry.ACC_USERS,
          "" + RepositoryEntry.ACC_USERS_GUESTS
        };
      String[] values = new String[] {
        pt.translate("cif.access.owners"),
        pt.translate("cif.access.owners_authors"),
        pt.translate("cif.access.users"),
        pt.translate("cif.access.users_guests"),
      };
      //use the addDropDownSingleselect method with null as label i18n - key, because there is no label to set. OLAT-3682
      accessSelbox = uifactory.addDropdownSingleselect("accessBox",null, fic, keys, values, null);
      accessSelbox.select(selectedAccess, true);
     
View Full Code Here

    init(ureq);
  }

  private void init(UserRequest ureq) {

    translator = new PackageTranslator(PACKAGE, ureq.getLocale());
    startPage = new VelocityContainer("olatmodcprun", VELOCITY_ROOT + "/run.html", translator, this);

    // show browse mode option only if not assessable, hide it if in "real test mode"
    isAssessable = config.getBooleanSafe(ScormEditController.CONFIG_ISASSESSABLE);
View Full Code Here

   */
  public String informOnDelete(Locale locale, ICourse course) {
    CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
    Property forumKeyProperty = cpm.findCourseNodeProperty(this, null, null, FORUM_KEY);
    if (forumKeyProperty == null) return null; // no forum created yet
    return new PackageTranslator(PACKAGE_FO, locale).translate("warn.forumdelete");
  }
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.