Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2940

Allow formatting for dates for any language in certificates, not only user language

    XMLWordPrintable

    Details

      Description

      In the course PDF certificates can be generated. There is no way to add different certificate templates per language. The workaround so far has been to implement a multi-language certificate (A PDF with a page per language, the user can then print his desired language). This has also the advantage that the user can hand the certificate to different people depending on their language skills. 

      The problem now is that the date formatting is always done using the user language. When the user has set his language to EN, in the PDF all dates will be formatted in EN-style. For the german part of the certificate this looks odd. 

      The solution to this problem is to add a custom formatter to the velocity context that is used to generate the certificate. This special formatter will extend the standard formatter already there with a method that implements formatting giving a specific locale. 

      Example:

       

      $formatter.formatDateLong($dateCertificationRaw,"de")
      

       

      In Addition, the "raw" variant of the date should also be available for the "to" and "from" date (currently not the case). 

       

      note: this is only applicable to the HTML based certificate templates, the explained methods can not be implemented for the PDF-Form certificates.  

       

       

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            gnaegi Florian Gnägi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 50 minutes
                50m