No announcement yet.

PDF templates do not respect localization in all cases.

  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF templates do not respect localization in all cases.

    Hi there,

    I just tried to print a custom entity as a PDF file and while that basically works as expected, I encountered a problem when it comes to localized option fields. I am using an external reference to a contacts salutionName that I want to appear in the pdf. For some reason only the english version is printed out (Mr. Simpson) while the system is configured to use the German translation (Herr Simpson). Is there something I can use inside the template to enforce a localization the field's value?

  • #2
    Totally didn't aware of Localization in PDF Template, the demo is not loading for me so I can't confirm it.

    But I assume you already Localized/Translate the Salutation field in Language? More specifically:

    Admin > Label Manager (or use URL below + your website name)

    Under options

    I had a quick check and it look Salutation isn't translated, so you have to translate it first?

    salutationName . Mr.
    Last edited by espcrm; 08-25-2020, 07:20 AM.


    • #3
      The field is localized, and the standard language of the installation is set to German. Everything works in the UI as expected, it's just the PDF that's wrong.


      • #4
        Hi Hendrik,
        PDF document generator uses a language format that depends on the system language selected in Administration -> Settings -> Language. I your case it seems that the system language is English.
        If you need the system language - English, but a text in PDF should be translated, I believe you need to develop a custom template helper to use the specific language with the way like this:
         {{dateFormat createdAt_RAW format='MMMM DD' [COLOR=#c0392b]language='de_DE'[/COLOR]}}


        • #5
          Hendrik Belitz Here to bring you some good news. I believe this patch has now fixed your issue (you can do a manual update or wait until v6). Please see this issue:

          In documentation:


          • #6
            Great. Thank you for that information.