breaking change in localization extension when upgrading from 3.0.1 to 3.1.1?



  • Hi,

    we have templates in folders like this:
    0_1639387491241_Screenshot from 2021-12-13 16-24-16.png

    in test.template, I use the localize function:

    {{localize "test" "./translations"}}
    

    The following request to /api/report succeeds on jsreport 3.0.1:

    {     
          "template": { "name" : "/testfolder/test.template" },
          "data" : { "test": "bar" },
          "options": {
              "localization": {
                  "language": "en"
              }
          }
    }
    

    However, on jsreport 3.1.1 it fails with this error:

    {
        "message": "Error when evaluating engine handlebars for template /testfolder//testfolder/test.template\nlocalize helper couldn't find asset with data at translations/en.json",
        "stack": "Error: localize helper couldn't find asset with data at translations/en.json\n    at Object.localize (/app/node_modules/@jsreport/jsreport-localization/lib/worker.js:42:17)"
    }
    

    Am I doing something wrong? Apparently, the localize helper can't resolve the relative folder reference any more. Thanks in advance!

    (see attached export file sorry, I can't seem to upload non-image files)



  • Thank you for reporting. I'm able to reproduce it. It's bug.
    I've submitted it also to the github https://github.com/jsreport/jsreport/issues/847
    We will fix this in update 3.2.0 this week.
    I apologize for the problems.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.