Issues with localization after upgrading to JSReport 3.7.1
-
Hi,
After upgrading our JSreport 2.11.0 to 3.7.1 version we had some breaking changes related to localization in our reports that contain translations.
We made the following changes to our reports to solve the localization issues:
-
Changed the locale/en-data.json directory to be named as localization/en.json
-
Restructure JSON format to be not nested in locale/en.json
-
Changed the templates to use the new keys. For example: {{$localizedResource.myReportKey.title}} to be {{localize "myReportKeyTitle" "localization"}}
-
Define the localizations to be used in all the report templates
After those changes, the reports started working agaian. However, for us those changes are major because we have built some other custom reports on top of the old reports. So, the question is: How can we deal with backwards compatibility with regard to our old reports that use the old localization extension {{$localizedResource.myReportKey.title}}?
Thanks in advance
-
-
https://jsreport.net/learn/v3-migration-guide#resources-extension
The v3 automatically migrates the old structured localization files into the new form.
Haven't you tried this path? The migration procedure creates new script that mocks the old behavior so you can continue using{{$localizedResource.myReportKey.title}}
even its not recommended in the long term.