Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF Invoices not getting translated when attached to emails #943

Open
alexmigf opened this issue Dec 24, 2024 · 0 comments
Open

PDF Invoices not getting translated when attached to emails #943

alexmigf opened this issue Dec 24, 2024 · 0 comments
Assignees
Labels

Comments

@alexmigf
Copy link
Member

A customer reported issues with translating PDF attachments when using WPML.

I am using the free version of this plugin (3.9.3), together with WPML, and it has been working wonderfully for years! Our default site language is not English, and invoices were always correctly sent in our default language.

However, after upgrading WordPress to version 6.7 (known to have caused several issues with localization) and persisting through 6.7.1, invoices attached in emails (!) are not translated to the default site language, but are all in English. The issue does not happen when previewing invoice directly in WordPress.

I believe this is due to Main.php:139, where translation is being unloaded, then load_plugin_textdomain is called for the second time, which has no effect anymore and the translations are not reloaded.

I have been able to fix this issue by putting

add_filter('wpo_wcpdf_allow_reload_attachment_translations', '__return_false');

into our theme’s functions.php file.

I hope this solution helps anyone else having a similar problem.

@alexmigf alexmigf self-assigned this Dec 24, 2024
@alexmigf alexmigf added the bug label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant