Reputation: 1553
I would like to know if jsreport have the ability to translate report to other languages. For example in the data I sent to jsreport to render has language of choice(Germany, Italian,...), can I do anything (setup in template, call external services,etc.) to translate some key texts into those language.
However, this question is about general jsreport current support of multi-languages
Upvotes: 0
Views: 928
Reputation: 3095
This is currently ([email protected]) implemented using resources extension.
http://jsreport.net/learn/resources
Resources extension lets you attach multiple JSON data objects to the report template and later conveniently access them using templating engines or in custom scripts. This can be useful to add a general configuration to the template or mainly localize the template...
The main approach to implement the localization using resources extension:
en-myresource
, de-myresource
$localizedResource
to reach the localized values in the templating engine, for example {{:$localizedResource.invoice.title}}
{ template: {...}, options: { language: "de" } }
Example: https://playground.jsreport.net/studio/workspace/VkLWfMyMb/7
Upvotes: 2