Examples of PackageTranslator


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

    this.portalColumns = portalColumns;
    this.portletsConfigurations = portletsConfigurations;   
    this.portletContainers = new HashMap<String, PortletContainer>();
    this.inactivePortlets = new ArrayList<String>();

    this.trans = new PackageTranslator(Util.getPackageName(PortalImpl.class), ureq.getLocale());
    this.portalVC = new VelocityContainer("portalVC", VELOCITY_ROOT + "/portal.html", trans, this);    // initialize arrays

    // calculate the column css classes based on YAML schema
    int cols = portalColumns.size();
    List<String> columnCssClassWrapper = new ArrayList(cols);
View Full Code Here

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

    //TODO remove the below warn again once OLAT-5715 has been resolved - or it turns out that below warn is too verbose
    // the idea is that at this stage the throwable still contains a stacktrace but passed into the OLATRuntimeException
    // below as the cause it somehow gets lost. If this does not turn out to be true then the line below can be removed.
    // in any case, it is just a log.warn
    Tracing.logWarn("ExceptionWindowController<init>: Throwable occurred, logging the full stacktrace:", th, getClass());
    Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    Formatter formatter = Formatter.getInstance(ureq.getLocale());
    msg = new VelocityContainer("olatmain", VELOCITY_ROOT + "/exception_page.html", trans, this);
    // disallow wrapping of divs around the panel and the main velocity page
    // (since it contains the "<html><head... intro of the html page,
    // and thus has better to be replaced as a whole (new page load) instead of
    // a dom replacement)
    msg.setDomReplaceable(false);
   
    Version v = (Version) CoreSpringFactory.getBean("org.olat.core.Version");
    msg.contextPut("buildversion", v.getVersion());

    OLATRuntimeException o3e;
   
    if (th == null){
      o3e = new OLATRuntimeException("Error Screen with a Throwable == null", null);
    } else if (!(th instanceof OLATRuntimeException)) {
      o3e = new OLATRuntimeException(th.getMessage(), th);
    } else {
      o3e = (OLATRuntimeException) th;
    }

    String detailedmessage = null;
    // translate user message if available
    if (o3e.getUsrMsgKey() != null && o3e.getUsrMsgPackage() != null) {
      PackageTranslator usrMsgTrans = new PackageTranslator(o3e.getUsrMsgPackage(), ureq.getLocale());
      if (o3e.getUsrMsgArgs() == null) {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey());
      } else {
        detailedmessage = usrMsgTrans.translate(o3e.getUsrMsgKey(), o3e.getUsrMsgArgs());
      }
    }
    // fix detailed message
    if (detailedmessage == null) {
      if (o3e instanceof StaleObjectRuntimeException) {
View Full Code Here

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

    this.bundleName = bundleName;
    this.page = page;
    contextHelpWrapperVC = createVelocityContainer("contexthelpwrapper");   
    // Initialize the page mapper - must be done before calling createHelpPage()
    initPageResourceMapper()
    pageTranslator = new PackageTranslator(bundleName, getLocale());
    contextHelpPageVC = createHelpPage(bundleName, page);               
   
    // Add page infos and rating
    addPageInfos();
    addPageRating(ureq);
View Full Code Here

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

    *
    *
    */
  public SinglePageController(UserRequest ureq, WindowControl wControl, boolean inIframe, VFSContainer rootContainer, String fileName, String currentUri, boolean allowRelativeLinks, boolean showHomeLink, OLATResourceable contextResourcable) {
    super(wControl);
    trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    Panel mainP = new Panel("iframemain");
    myContent = new VelocityContainer("singlepagecontent", VELOCITY_ROOT + "/index.html", trans, this);
   
    homeLinkP = new Panel("homelink");
    homeLinkContent = new VelocityContainer("homelinkcontent", VELOCITY_ROOT + "/homelink.html", trans, this);
View Full Code Here

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

   * @param locale locale that should be used for message localization
   */
  public Emailer(Locale locale) {
    this.mailfrom =  WebappHelper.getMailConfig("mailFrom");
    // initialize the mail footer with info about this OLAt installation
    PackageTranslator trans = new PackageTranslator(Util.getPackageName(Emailer.class), locale);
    footer = trans.translate("footer.no.userdata", new String[] { Settings.getServerContextPathURI() });
  }
View Full Code Here

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

    // initialize the mail footer with infos about this OLAT installation and the user who sent the mail
    User user = mailFromIdentity.getUser();
   
    Locale locale = I18nManager.getInstance().getLocaleOrDefault(user.getPreferences().getLanguage());
   
    PackageTranslator trans = new PackageTranslator(Util.getPackageName(Emailer.class), locale);
    String institution = user.getProperty(UserConstants.INSTITUTIONALNAME, null);
    if (institution == null) institution = "";
    footer = trans.translate("footer.with.userdata", new String[] { user.getProperty(UserConstants.FIRSTNAME, null), user.getProperty(UserConstants.LASTNAME, null), mailFromIdentity.getName(),
        institution, Settings.getServerContextPathURI()  });

  }
View Full Code Here

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

   * @param template Default values taken from this template
   * @param useCancel
   * @param listeningController Controller that listens to form events
   */
  public MailTemplateForm(Locale locale, MailTemplate template, boolean useCancel, Controller listeningController) {
    super("MailTemplateForm", new PackageTranslator(Util.getPackageName(MailTemplateForm.class), locale));
   
    addListener(listeningController);

    String[] skipKeys = new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() };
    String[] skipValues = new String[] { translate("yes"), translate("no") };
View Full Code Here

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

   * @param maxSteps
   */
  public WizardInfoController(UserRequest ureq, int maxSteps) {
    super(null);
    this.maxSteps = maxSteps;
    Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    myContent = new VelocityContainer("genericwizard", VELOCITY_ROOT + "/wizard_steps.html", trans, null);

    myContent.contextPut("max", String.valueOf(maxSteps));
    myContent.contextPut("myself", this);
    setCurStep(1);
View Full Code Here

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

   * @param steps
   */
  public WizardController(UserRequest ureq, WindowControl wControl, int steps) { super(wControl);
    this.steps = steps;
   
    this.trans = new PackageTranslator(PACKAGE, ureq.getLocale());
    this.wizardVC = new VelocityContainer("wizard", VELOCITY_ROOT + "/wizard.html", this.trans, this);
    finishButton = LinkFactory.createCustomLink("finish", "cmd.wizard.cancel", "cmd.wizard.finished", Link.BUTTON, this.wizardVC, this);
    cancelButton = LinkFactory.createCustomLink("cancel", "cmd.wizard.cancel", "cmd.wizard.cancel", Link.BUTTON, this.wizardVC, this);
   
    this.wic = new WizardInfoController(ureq, this.steps);
View Full Code Here

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

  private static Translator getTranslator(Locale locale) {
    String ident = locale.toString();
    synchronized (translators) {  //o_clusterok   brasato:::: nice idea, but move to translatorfactory and kick out translator.setLocale() (move it to LocaleChangableTranslator)
      Translator trans = translators.get(ident);
      if (trans == null) {
        trans = new PackageTranslator(Util.getPackageName(Emailer.class), locale);
        translators.put(ident, trans);
      }
      return trans;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.