Package org.olat.core.gui.translator

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


   */
  private void appendContextInfo(StringBuffer buf, BGContext context, Locale userLocale) {
    List<String> titles = getCourseTitles (context);
    DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, userLocale);
    String formattedDate = dateFormat.format(new Date());
    Translator trans = getPackageTranslator(userLocale);
    buf.append(EOL);
    buf.append(trans.translate("archive.coursename"));
    buf.append(DELIMITER);
    buf.append(trans.translate("archive.date"));
    buf.append(EOL);
   
    Iterator<String> titleIterator = titles.iterator();
    int i=0;
    while(titleIterator.hasNext()) {
View Full Code Here


   */
  public boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    ReferenceManager refM = ReferenceManager.getInstance();
    String referencesSummary = refM.getReferencesToSummary(res, ureq.getLocale());
    if (referencesSummary != null) {
      Translator translator = Util.createPackageTranslator(RepositoryManager.class, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary }));
      return false;
    }
    return true;
  }
View Full Code Here

    // get some data about the actor and fetch the translated subject / body via
    // i18n module
    String[] bodyArgs = new String[] { actor.getUser().getProperty(UserConstants.FIRSTNAME, null), actor.getUser().getProperty(UserConstants.LASTNAME, null), actor.getUser().getProperty(UserConstants.EMAIL, null),
        actor.getName() };
    Locale locale = I18nManager.getInstance().getLocaleOrDefault(actor.getUser().getPreferences().getLanguage());
    Translator trans = BGTranslatorFactory.createBGPackageTranslator(Util.getPackageName(BusinessGroupManager.class), group.getType(),
        locale);
    String subject = trans.translate(subjectKey);
    String body = trans.translate(bodyKey, bodyArgs);

    // create a mail template which all these data
    MailTemplate mailTempl = new MailTemplate(subject, body, null) {
      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity identity) {
View Full Code Here

  /**
   *
   */
  public RepositorySite(Locale loc) {
    //TODO:fj:b cache all Translators in olat, introduce ChangeableTranslator (with method setLocale(...))
    Translator trans = new PackageTranslator(PACKAGE, loc);
    origNavElem = new DefaultNavElement(trans.translate("topnav.dr"), trans.translate("topnav.dr.alt"), "o_site_repository");   
    origNavElem.setAccessKey("r".charAt(0));
    curNavElem = new DefaultNavElement(origNavElem);
  }
View Full Code Here

   */
  public boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    ReferenceManager refM = ReferenceManager.getInstance();
    String referencesSummary = refM.getReferencesToSummary(res, ureq.getLocale());
    if (referencesSummary != null) {
      Translator translator = new PackageTranslator(PACKAGE, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.references",
          new String[] { referencesSummary }));
      return false;
    }
    if (CoordinatorManager.getCoordinator().getLocker().isLocked(res, null)) {
      Translator translator = new PackageTranslator(PACKAGE, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.editor"));
      return false;
    }
    return true;
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.CourseNodeConfiguration#getLinkText(java.util.Locale)
   */
  public String getLinkText(Locale locale) {
    Translator translator = Util.createPackageTranslator(CalCourseNodeConfiguration.class, locale);
    return translator.translate("calendar.title");
  }
View Full Code Here

   */
  public boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    ReferenceManager refM = ReferenceManager.getInstance();
    String referencesSummary = refM.getReferencesToSummary(res, ureq.getLocale());
    if (referencesSummary != null) {
      Translator translator = new PackageTranslator(PACKAGE, ureq.getLocale());
      wControl.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary }));
      return false;
    }
    return true;
  }
View Full Code Here

    Locale loc = I18nManager.getInstance().getCurrentThreadLocale();
    setLanguage(loc);
    // Use theme content css
    setContentCSSFromTheme(guiTheme);
    // Set link targets
    Translator trans = Util.createPackageTranslator(this.getClass(), loc);
    String sameWinTranslated = trans.translate("richText.element.target.window.alwayssame");
    setLinkTargets(sameWinTranslated + "=_olatpopup");   
    // Plugins without buttons
    setNoneditableContentEnabled(true, null);
    setContextMenuEnabled(true);
  }
View Full Code Here

   * @param wControl
   */
  public UsermanagerUserSearchController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);

    Translator translator = UserManager.getInstance().getPropertyHandlerTranslator(getTranslator());
    setTranslator(translator);
    userSearchVC = createVelocityContainer("usermanagerUsersearch");

    mailVC = createVelocityContainer("usermanagerMail");
    backFromMail = LinkFactory.createLinkBack(mailVC, this);
View Full Code Here

  public UsermanagerUserSearchController(UserRequest ureq, WindowControl wControl, SecurityGroup[] searchGroups,
      PermissionOnResourceable[] searchPermissionOnResources, String[] searchAuthProviders, Date searchCreatedAfter,
      Date searchCreatedBefore, Integer status, boolean showEmailButton) {
    super(ureq, wControl);

    Translator translator = UserManager.getInstance().getPropertyHandlerTranslator(getTranslator());
    setTranslator(translator);

    mailVC = createVelocityContainer("usermanagerMail");

    backFromMail = LinkFactory.createLinkBack(mailVC, this);
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.