[Feature Request] Export to XLIFF contains old translations
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're trying to export your site content in English to provide to a translation company, but the XLIFF file contains already translated content instead of just English, even after cancelling and reopening the translation jobs. Solution: We recommend the following workaround to ensure the XLIFF export contains only the original English content: 1. Ensure you back up your database and website before making any changes. 2. Edit the file
I am trying to export the site content in English to provide to our clients chosen translation company. When testing the translations, the company provided some pseudo-translations for me to test. I tested these and they worked okay so the company asked for the exports again in English.
When I export the pages, the XLIFF contains the pseudo-translated content instead of just English.
This is after cancelling the translation jobs and re-opening the jobs and exporting to XLIFF.
Thank you for contacting WPML support, I'd be happy to help you with this issue.
Please follow some steps below and see if it helps:
1. Make a small change to the page in English > Save changes.
2. Go to WPML > Translation Management > Send the page to translation.
3. Go to WPML > Translations > Export the job to translate the page to an XLIFF file.
If it doesn't help, please let me know the page URL and share the XLIFF file after you follow 3 steps above.
I think this is due to translation memory. I think the pseudotranslations have been saved to translation memory, so when the page are being exported the pseudotranslated content is still there. However, the translation team just want the exports in English.
Would it be possible for you clear the translation memory?
I understand the issue. Currently, there isn't an option to remove the translated content in the XLIFF file. You can follow the workaround below to remove it:
❌ IMPORTANT: Please backup your database and website before proceeding ❌
- Edit the file wp-content/plugins/sitepress-multilingual-cms/classes/xliff/class-wpml-tm-xliff-writer.php
- Around line 378, change the code:
Yes, it is a quick workaround for this case. The code will be overridden after updating WPML to the new version. You can keep using that workaround until there is an option for this.
Also, I think the translated content in the XLIFF file won't impact the translation process. You or the company can re-translate the content as well.
I hope I was helpful. Don't hesitate to ask if you find any problem along the way, I'll gladly help you.