Translation of PDF Documents not working properly

[ad_1]

Hi there
I am using Woocommerce and the Plugin “WooCommerce PDF Invoices & Packing Slips” to generate PDF Invoices. My site is german (default) and translated to french as well.
In order to translate PDF invoices I added this filter to my functions.php:
add_filter( 'weglot_translate_pdf', '__return_true' )

While the translation of the documents works perfectly fine in french, however, if I want to view the Invoice in german, it displays me a blank PDF. I assume the filter somehow interferes with the plugin. If I remove the filter, the german PDF is generated and displayed properly.

I am asking you: Is there a way to only activate this filter when the current language is french? Or how would you resolve this issue?

Many thanks for your help!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer