How to use Custom Translation to a custom html in Print Format?

Hello,

Anyone please help me to write a code for a custom html inside Print Format that how can I make it functional with Custom Translation? or are there any solutions defining some rules or conditions inside a Jinja tag to detect a print format’s language?

For example : If the print format’s language is chosen “en-uk”, the custom html displays “Analyse”. Or when the language is “en-us”, the custom html displays “Analyze”.

Thanks

Regards,

Hi @cipher,

If I understand your issue correctly, you can make any word translatable in a custom print format by using the following template: {{ _(“word”) }}

The translation will then be applied based on the translated words already available in Frappe/ERPNext or on the custom translation you define in your site.

The selected language depends on the form’s language (selectable in the print options for an invoice for example) or on the system language.

Does this work on ERPNext v15?

Yes, It works on version 15.
You have to create a translation and add this {{ _(“word”) }}